Azure CLI VM quick commands

less than 1 minute read

A few quick commands for Azure CLI to do stuff with virtual machines, so I don’t have to try and remember them…

Start VM
az vm start --resource-group [group] --name [name]

Get VM public IP addresses
az vm show -d --resource-group [group] --name [name] --query publicIps -o tsv

Shutdown VM
az vm stop --resource-group [group] --name [name]

Deallocate VM (stop cpu/mem billing)
az vm deallocate --resource-group [group] --name [name]