Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All the VMs in the VNET are shown as backend member of IP-based backend pool #2492

Open
shiniizuka opened this issue Nov 7, 2023 · 1 comment
Assignees

Comments

@shiniizuka
Copy link

This is for:
https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Workbooks/Network%20Insights/LoadBalancerWorkbooks/NetworkInsights-LoadBalancerMetrics-Minified/NetworkInsights-LoadBalancerMetrics-Minified.workbook

SYMPTOM:
When the backend pool is IP-based backend pool, not only the backend VMs but also all the VMs in the same VNET are shown as backend members.

CAUSE:
This seems to be the current limitation caused by current query:

Resources
| where type =~ "microsoft.network/loadbalancers" and id =~ '/subscriptions/de184a51-1f30-4b7a-82a8-3114064d716e/resourceGroups/DC_group/providers/Microsoft.Network/loadBalancers/LBTest'
| mv-expand BackendAddressPool = parse_json(properties).backendAddressPools
| mv-expand loadBalancerBackendAddresses = parse_json(BackendAddressPool).properties.loadBalancerBackendAddresses
| mv-expand virtualNetwork = parse_json(loadBalancerBackendAddresses).properties.virtualNetwork
| project virtualNetworkId = tolower(virtualNetwork.id)
| join (
    resources
    | where type == "microsoft.network/virtualnetworks"
    | mv-expand subnets = parse_json(properties).subnets
    | mv-expand ipconfigs = parse_json(subnets).properties.ipConfigurations
    | project virtualNetworkId = tolower(id), NICId = tolower(substring(ipconfigs.id, 0, indexof(ipconfigs.id, "/ipConfigurations/")))
) on virtualNetworkId
| where NICId contains "microsoft.network/networkInterfaces"
| join kind=inner
(
    resources
    | where type == "microsoft.network/networkinterfaces"
    | project NICId = tolower(id), BackendVM = properties.virtualMachine.id
) on NICId
| where isnotempty(BackendVM)
| project tolower(BackendVM), selected = true

It will be better if the query can be updatedto show actual backend members only.

@gardnerjr
Copy link
Collaborator

@snagpal99 it looks like you're the last one to modify this template, can you look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants