Last active
June 28, 2023 08:30
-
-
Save esarabadani/1fb6352657ba66ad4fb0899ba405c0bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources | |
| where type =~ "Microsoft.Network/loadBalancers" | |
| mv-expand backendAddressPool=properties.backendAddressPools | |
| mv-expand ipconfig=backendAddressPool.properties.backendIPConfigurations | |
| extend ipconfig_id=tostring(ipconfig.id) | |
| project LB_name=name, ipconfig_id | |
| join ( | |
resources | |
| where type =~ "Microsoft.Network/networkInterfaces" | |
| mv-expand ipconfig=properties.ipConfigurations | |
| extend ipconfig_id = tostring(ipconfig.id) | |
| extend nic_id = id | |
| extend nic_name = name | |
| project ipconfig_id, nic_id, nic_name) on ipconfig_id | |
| project LB_name, nic_name, nic_id, ipconfig_id | |
| join ( | |
resources | where type =~ "Microsoft.Compute/virtualMachines" | |
| mv-expand nic=properties.networkProfile.networkInterfaces | |
| extend nic_id = tostring(nic.id) | |
| extend vm_name = name | |
| mv-expand az_assignment = zones | |
| project nic_id, vm_name, az_assignment, app_tag=tostring(tags.App)) on nic_id | |
| project Load_Balancer=LB_name, Virtual_Machine=vm_name, Network_Interface=nic_name, Availability_Zone=az_assignment, Application=app_tag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment