[Azure Load Balalncer]How to extract the report for Azure Load Balancer Inbound NAT rule V1 for Azure VMs and Azure VMSS the using query in Azure portal and extract with subscription name ,ResourceGroup,LoadBalancer Name

Lineesh Mm (PSP) 0 Reputation points
2026-05-29T16:20:42.04+00:00

How to extract report for Azure Load Balancer Inbound NAT rule V1 for Azure VMs and Azure VMSS the using query in Azure portal and extract with subscription name ,ResourceGroup,LoadBalancer Name

Azure Load Balancer
Azure Load Balancer

An Azure service that delivers high availability and network performance to applications.

0 comments No comments

3 answers

Sort by: Oldest
  1. AI answer

    2026-05-29T16:21:05.05+00:00

    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:

    1. Open the Azure portal.
    2. Search for and open Resource Graph Explorer.
    3. Select the desired subscriptions in the left pane.
    4. Paste the query above into the query window.
    5. Run the query and then use Export to CSV or Export to Excel to get a report.

    Notes:

    • subscriptionId and resourceGroup columns come directly from the Resources table.
    • lbName is the load balancer name.
    • backendIPConfiguration will 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:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Jerald Felix 18,680 Reputation points Volunteer Moderator
    2026-05-29T16:45:31.6733333+00:00

    Hello Lineesh Mm (PSP),

    Greetings! Thanks for raising this question in Q&A forum.

    This is a great question! The reason there's no direct "export" button for Inbound NAT rules in the Azure Load Balancer blade is that Azure doesn't provide a built-in report for this out of the box. However, you can easily extract this information using the Azure Resource Graph Explorer in the Azure portal it lets you query your resources across subscriptions and export the results to CSV or Excel.

    Here's a simple step-by-step guide to get it done:

    Open the Azure Portal and in the top search bar, type "Resource Graph Explorer" and open it.

    On the left side of the Resource Graph Explorer, make sure you select the subscriptions you want to query.

    Copy and paste the following Kusto query into the query window:

    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
    

    Click the "Run query" button. The results will appear in a table below showing the Subscription ID, Resource Group, Load Balancer Name, NAT Rule Name, Frontend Port, Backend Port, Protocol, and Backend target details.

    Once results are displayed, click "Export to CSV" or "Export to Excel" from the top of the results pane to download your report.

    A few helpful things to note:

    • The subscriptionId and resourceGroup columns are pulled automatically from the Resources table.
    • The backendIPConfiguration column will point to either an Azure VM NIC or a VMSS NIC instance, so you can distinguish between VMs and VMSS during post-processing if needed.
    • This query works for both V1 (single backend IP) and V2 (backend pool/VMSS) style NAT rules both are surfaced through the same properties.inboundNatRules field.

    This approach gives you a clean, complete report across all your Load Balancers in one go without having to click through each resource manually!

    If this answer helps you kindly accept the answer which will help others who have similar questions.

    Best Regards,

    Jerald Felix.

    Was this answer helpful?

    0 comments No comments

  3. Venkatesan S 10,830 Reputation points Microsoft External Staff Moderator
    2026-06-01T18:28:14.84+00:00

    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:

    1. Go to Azure Portal → Resource Graph Explorer
    2. 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
      
    3. Hit “Run” and you’ll see a table of every Inbound NAT rule (V1) with your subscription ID, RG, LB name and rule details.
    4. 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

    Kindly let us know if the above helps or you need further assistance on this issue.

    Please do not forget to 210246-screenshot-2021-12-10-121802.pngand “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.