I'm trying to get the status of all the VMs in a resource group using rest interface for Azure RM.
I can get the status of 1 VM by using the URL https://management.azure.com/subscriptions/[SubscriptionId]/resourceGroups/[ResourceGroup]/providers/Microsoft.Compute/virtualmachines/[serverName]?$expand=instanceView
and I can get all the VMs using this URL https://management.azure.com/subscriptions/[SubscriptionId]/resourceGroups/[ResourceGroup]/providers/Microsoft.Compute/virtualmachines
however this doesn't return the status of the VMs. I tried passing $expand=instanceView but that doesn't have any affect when I'm getting all the VMs.
instanceView
thing is tied to the VM resource, not the resource group or Microsoft.Compute provider. You'll have to iterate though the VMs and call$expand=instanceView
. – evilSnobu