简体   繁体   中英

Get Azure resources associated with a subnet through Azure Resource Graph Query

I am looking to fetch all resources associated with a su.net. I could find references oh how to do it the other way around (fetch a particular resource and it includes the su.net it is associated with), but can't find any documents where we can fetch all resources linked with a su.net.

My ultimate goal is to fetch all azure resources which use a particular.network security group. That led me to the above question.

From another question I understand I can use a REST Api to get details for a specific virtual.network. How to check is su.net allocated with another resource in azure using Fluent API or management API? . I would appreciate if someone could suggest anyway to achieve this.

Thanks in advance.

Found the answer myself:p. You get the associated devices within the su.net details along with other details on getting virtua.networks.

Resource graph query:

resources
| where type =~ "microsoft.network/virtualnetworks"

properties->su.nets->properties->ipConfigurations

The ipConfigurations are the connected devices.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM