SOLVED

How to Extract "Load balancing type" from Log Analytics or Resource Explorer

%3CLINGO-SUB%20id%3D%22lingo-sub-1783437%22%20slang%3D%22en-US%22%3EHow%20to%20Extract%20%22Load%20balancing%20type%22%20from%20Log%20Analytics%20or%20Resource%20Explorer%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1783437%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20get%20the%20value%20of%20%22Load%20balancing%20type%22%20(Public%2FPrivate)%20as%20shown%20in%20the%20Properties%20blade%20under%20a%20Load-Balancer%20via%20KQL%20from%20either%20Resource%20Explorer%20or%20from%20a%20table%20available%20within%20Log%20Analytics%20Workspace.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20seems%20this%20property%20might%20not%20be%20exposed%20by%20MS%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJ%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1783437%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELoad-Balancer%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1785011%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Extract%20%22Load%20balancing%20type%22%20from%20Log%20Analytics%20or%20Resource%20Explorer%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1785011%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F658614%22%20target%3D%22_blank%22%3E%40JoVuon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ethis%20property%20is%20not%20exposed%20explicitly%2C%20but%20you%20can%20infer%20the%20LB%20type%20by%20looking%20at%20the%20Frontend%20IP%20Configurations%20and%20determine%20if%20its%20Public%20or%20Internal%20by%20checking%20if%20it%20has%20a%20Public%20IP%20or%20not.%20The%20Az%20Resource%20Graph%20query%20below%20makes%20it%20clearer%2C%20I%20guess%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3Eresources%0A%7C%20where%20type%20%3D~%20'Microsoft.Network%2FloadBalancers'%0A%7C%20mvexpand%20FrontendIPs%20%3D%20properties.frontendIPConfigurations%0A%7C%20where%20array_length(FrontendIPs.properties.loadBalancingRules)%20%26gt%3B%200%0A%7C%20extend%20loadBalancerType%20%3D%20iif(isempty(FrontendIPs.properties.publicIPAddress)%2C%22Internal%22%2C%22Public%22)%0A%7C%20summarize%20by%20id%2C%20name%2C%20location%2C%20loadBalancerType%2C%20resourceGroup%2C%20subscriptionId%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1813440%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Extract%20%22Load%20balancing%20type%22%20from%20Log%20Analytics%20or%20Resource%20Explorer%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1813440%22%20slang%3D%22en-US%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F453722%22%20target%3D%22_blank%22%3E%40hspinto%3C%2FA%3E%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20will%20work.%20Thanks%20for%20that.%3CBR%20%2F%3E%3CBR%20%2F%3EJ%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi,

 

I'm trying to get the value of "Load balancing type" (Public/Private) as shown in the Properties blade under a Load-Balancer via KQL from either Resource Explorer or from a table available within Log Analytics Workspace. 

 

It seems this property might not be exposed by MS?

 

 

J

2 Replies
best response confirmed by JoVuon (Occasional Contributor)
Solution

@JoVuon 

 

this property is not exposed explicitly, but you can infer the LB type by looking at the Frontend IP Configurations and determine if its Public or Internal by checking if it has a Public IP or not. The Az Resource Graph query below makes it clearer, I guess:

 

resources
| where type =~ 'Microsoft.Network/loadBalancers'
| mvexpand FrontendIPs = properties.frontendIPConfigurations
| extend loadBalancerType = iif(isempty(FrontendIPs.properties.publicIPAddress),"Internal","Public"), skuName=tostring(sku.name)
| summarize by id, name, skuName, location, loadBalancerType, resourceGroup, subscriptionId

 

 

Hi @hspinto,

This will work. Thanks for that.

J