An Azure service that delivers high availability and network performance to applications.
Azure Resource Graph can be used from the Azure portal (Resource Graph Explorer) to query inbound NAT rules on load balancers and include subscription, resource group, and load balancer name.
Example Kusto query to list inbound NAT rules (V1/V2) for load balancers, including subscription, resource group, and LB name:
Resources
| where type == "microsoft.network/loadbalancers"
| extend lbName = name
| mv-expand inboundNatRules = properties.inboundNatRules
| extend natRuleName = tostring(inboundNatRules.name)
| extend natRuleProps = inboundNatRules.properties
| project
subscriptionId,
resourceGroup,
lbName,
natRuleName,
frontendIPConfiguration = tostring(natRuleProps.frontendIPConfiguration.id),
frontendPort = tostring(natRuleProps.frontendPort),
backendPort = tostring(natRuleProps.backendPort),
protocol = tostring(natRuleProps.protocol),
backendPool = tostring(natRuleProps.backendAddressPool.id),
backendIPConfiguration = tostring(natRuleProps.backendIPConfiguration.id)
| order by subscriptionId, resourceGroup, lbName, natRuleName
Steps in the Azure portal:
- Open the Azure portal.
- Search for and open Resource Graph Explorer.
- Select the desired subscriptions in the left pane.
- Paste the query above into the query window.
- Run the query and then use Export to CSV or Export to Excel to get a report.
Notes:
-
subscriptionIdandresourceGroupcolumns come directly from theResourcestable. -
lbNameis the load balancer name. -
backendIPConfigurationwill point to a specific NIC IP configuration (Azure VM) or VMSS NIC instance, which can be post-processed if needed to distinguish VMs vs VMSS. - This query enumerates inbound NAT rules on all standard load balancers in the selected subscriptions; V1 vs V2 is determined by how the rule is configured (single backend IP vs backend pool/VMSS), but both are surfaced through
properties.inboundNatRules.
References:
and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.