π Getting Started with Azure CLI on Windows (via CMD and VS Code)
Whether you're just exploring Azure or managing cloud infrastructure at scale, Azure CLI gives you powerful control from your terminal. In this guide, weβll walk through installing Azure CLI on Windows, logging in, managing resource groups, VMs, storage accounts, and executing Bash scripts in VS Code.
π₯ 1. Install Azure CLI on Windows
π Install Azure CLI on Windows
az --version
π 2. Login to Azure
az login
az login --tenant <your-tenant-id>
β 3. Subscription Selection
az account set --subscription "<your-subscription-name>"
π 4. List Resource Groups
az group list --output table
az group list --output yaml
π 5. Create a Resource Group
az group create --name azurecli-rg --location westus
az group list --output table
(https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8tf5pq9c7qaxhyrr7kn5.jpg)
π» 6. View Virtual Machines
az vm list --output table
πΎ 7. List Storage Accounts
az storage account list
π§ 8. Use Bash for Variables
VS Code makes it easy to define variables for more advanced scripts.
π§ͺ 9. Create a VM and Network
Run all setup commands together using defined variables.
(https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fpkzx18lluqlx19w0ncg.JPG)
π§Ή 10. Delete Resources
az vm delete --resource-group azurecli-rg --name TutorialVNet1 --yes
az group delete -n azurecli-rg
π§΅ Wrapping Up
Youβve now seen how to:
- Install and run Azure CLI from CMD
- Authenticate and manage subscriptions
- Create/list/delete Azure resource groups and VMs
- Use Bash in VS Code for efficient scripting
π¬ Got feedback or tips? Drop a comment below!
Top comments (0)