An Azure service that delivers high availability and network performance to applications.
Hi Lineesh Mm (PSP),
Thanks for reaching out in Microsoft Q&A forum,
If you want to pull a report of all your Azure Load Balancer Inbound NAT Rule V1 entries (both single-VM and VMSS) along with Subscription, Resource Group and Load Balancer name, you can do it right from the Azure Portal using Resource Graph Explorer (or via CLI/PowerShell). Here’s a quick walkthrough:
- Go to Azure Portal → Resource Graph Explorer
- Paste and run this Kusto query:
Resources | where type == "microsoft.network/loadbalancers" | mv-expand inboundNat = properties.inboundNatRules | project SubscriptionId = subscriptionId, ResourceGroup = resourceGroup, LoadBalancer = name, NatRuleName = inboundNat.name, FrontendIPConfig = tostring(inboundNat.frontendIPConfiguration.id), FrontendPort = inboundNat.frontendPort, BackendPort = inboundNat.backendPort, Protocol = inboundNat.protocol - Hit “Run” and you’ll see a table of every Inbound NAT rule (V1) with your subscription ID, RG, LB name and rule details.
- Click the “Export” button (CSV/JSON) to download your report.
If you’d rather use Azure CLI (in Cloud Shell) you can achieve the same across a single RG or the entire subscription like this:
az network lb inbound-nat-rule list \
--query "[].{
Subscription: subscriptionId,
ResourceGroup: resourceGroup,
LoadBalancer: loadBalancerName,
NatRule: name,
FrontendPort: frontendPort,
BackendPort: backendPort,
Protocol: protocol
}" \
-o table
And in PowerShell:
Get-AzLoadBalancer | ForEach-Object {
$lb = $_
$lb.InboundNatRules | Select-Object `
@{N='Subscription';Expression={$lb.Id.Split('/')[2]}},
@{N='ResourceGroup';Expression={$lb.ResourceGroupName}},
@{N='LoadBalancer';Expression={$lb.Name}},
Name, FrontendPort, BackendPort, Protocol
}
Hope that helps you build your report in minutes!
Reference docs
- Inbound NAT rules overview: https://learn.microsoft.com/azure/load-balancer/inbound-nat-rules
- Manage inbound NAT rules (incl. CLI/PS examples): https://learn.microsoft.com/azure/load-balancer/manage-inbound-nat-rules
- Monitor Load Balancer via Log Analytics: https://learn.microsoft.com/azure/load-balancer/monitor-load-balancer#log-analytics-query-for-vnet-flow-logs
- Nat rules v1→v2 migration guidance: https://learn.microsoft.com/azure/load-balancer/load-balancer-nat-pool-migration
Kindly let us know if the above helps or you need further assistance on this issue.
Please do not forget to
and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.