For system, network and cloud administrators
In order to verify an Azure virtual machine’s power state, you can use:
az vm get-instance-view --resource-group YourResourceGroup --name YourVMName --query "instanceView.statuses[?starts_with(code, 'PowerState/')].displayStatus" -o tsv