I am trying to report on what Virtual Machines are assigned to Virtual Machine reservations.
In Azure, i can see the reservations in the reservations blade in azure:
For each active reservation i can click in and view Virtual machines that are assigned.
I cannot find this information in graph explorer. It seems to do reservation groups but not Virtual Machine reservations.
Am I missing something, or overlooking it completely?
Appreciate any expertise.
According to the Microsoft Q&A, you can try below query workaround to retrieve the count of reservations attached to the VM.
Output:
Note: The above query might not work in all the scenarios, and your functionality is not exactly supported by resource graph queries.
Hence to make it work as expected in all cases, I would suggest you use an API or PowerShell command
Get-AzReservation
to retrieve the reservations that are attached to the specific VM.