Azure

Azure CLI Cheatsheet

Essential Azure CLI commands for resource management, VMs, and storage.

19 commands
Windows MacOS Linux
#cloud #microsoft #infrastructure

Authentication & Account

Login to Azure
az login
List subscriptions
az account list
Set active subscription
az account set -s <sub-id>
Show current subscription
az account show

Resource Groups

List resource groups
az group list
az group create -n <name> -l <location>
Delete resource group
az group delete -n <name>

Virtual Machines

List VMs
az vm list
az vm create -g <rg> -n <name> --image UbuntuLTS
az vm start -g <rg> -n <name>
az vm stop -g <rg> -n <name>
az vm delete -g <rg> -n <name>

Storage

List storage accounts
az storage account list
az storage account create -n <name> -g <rg> -l <location>
az storage blob upload --account-name <name> -c <container> -f <file>
az storage blob list --account-name <name> -c <container>

Quick Commands

Login to Azure interactively
az login
List all VMs in table format
az vm list -o table
Create resource group
az group create -n myRG -l eastus