Load Balancers Table view Azure CLI

Copper Contributor

Hi,

 

I`m trying to pull the below table in Azure CLI or Powershell and I cant, this is the portal table information which it cant be exported to csv ....

 

I`m working to get a script in place to route all the diagnostic settings from the PUBLIC Load balance to an event HUB, but in order to do this I have to identify which one is Public and which one is Private and I cant find what command to use to get this information.

 

Can someone help me pls to get the below table or to get load balance:  Name, Id, Load balance Type ?

 

load_balancer_portal_table.jpg

1 Reply

@NumBillniF the best Azure resource for this type of need is Azure Resource Graph. You can use it in the Azure Portal, by opening the Azure Resource Graph Explorer blade and run the query below. You can download the results as CSV.

 

resources
where type =~ 'Microsoft.Network/loadBalancers'
extend lbType = iif(isnull(properties.frontendIPConfigurations[0].properties.publicIPAddress), 'internal''public')
project id, name, resourceGroup, location, lbType

 

clipboard_image_3.png

 

You can also use Azure Resource Graph from CLI. Learn more about it here.