I want to list all Virtual Machine names that contain a private IP address under a specific subnet (e.g., named "sub-a"). How do I do that?
I was hoping that this query in Azure Resource Graph Explorer would at least print all non empty private IP addresses:
Resources
| where type =~ 'microsoft.compute/virtualmachines' and isnotempty(properties.privateIPAddress)
You need to look at the Network Interfaces and expand the properties to pull the Private IP address. Something like this should do the trick. I modified one of our examples to pull private IP instead of public IP.