Azure CLI to check VM status

You can use the '-d' flag with list and status for all VMs

az vm list -d -o table

For single VM, you can use:

az vm list -d -o table --query "[?name=='vm-name']"

If you need more specific results then you can also try:

az vm list -d --query "[?powerState=='VM running']" -o table

You can get the vm status with this command:

az vm get-instance-view --name vmName --resource-group resourceGroupName --query instanceView.statuses[1] --output table

The output will like this:

enter image description here