cancel
Showing results for 
Search instead for 
Did you mean: 

Get Power state of Azure virtual machine

Want to get power state of Azure Virutal Machines.

Refering this blog

last(body('Read_a_resource')?['statuses'])?['code']

may return 'PowerState/deallocated' or 'PowerState/running', but body('Read_a_resource')?['statuses'] returns NULL object in my environment.

 

Status: New
Comments
New Member

Same here...I get Null value as well.  Did you ever figure this out?

Microsoft

I was able to get this to work.  Did you check your API version?  If not, you can open the Azure Portal, go to the VM, then export configuration.  It will give you the ARM template for it and you can search for the API version it uses.