gourav rathore
gourav rathore

Reputation: 5

Azure Graph Query

I am creating a dashboard using graph query to populate headcount numbers of VMs with the state. (like stopped 23, running 23, etc.)

But not sure how can I write this or if it is possible.

And the second question again belong to Graph query and this is, I want to populate all unattached disk name but not able to achieve this. I can project name, location but not their status.

where type == "microsoft.compute/disks" | project name, location, (properties.diskState).unattached // highlighted part is not working

Upvotes: 0

Views: 166

Answers (1)

Joy Wang
Joy Wang

Reputation: 42063

But not sure how can I write this or if it is possible.

It seems not possible to query the VM state in azure resource graph.

And the second question again belong to Graph query and this is, I want to populate all unattached disk name but not able to achieve this. I can project name, location but not their status.

Try the query as below, it works fine on my side.

where type == "microsoft.compute/disks" and properties.diskState == "Unattached" | project name, location, properties.diskState

enter image description here

Upvotes: 0

Related Questions