fix: Set recommendationTypeId to null for zone-redundant Load Balancer#811
Open
richredgrave wants to merge 1 commit intoAzure:mainfrom
Open
fix: Set recommendationTypeId to null for zone-redundant Load Balancer#811richredgrave wants to merge 1 commit intoAzure:mainfrom
richredgrave wants to merge 1 commit intoAzure:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores Azure Resource Graph (KQL) execution for the “Ensure Standard Load Balancer is zone-redundant” recommendation by removing the Azure Advisor routing identifier, fixing a regression where internal/private load balancers were no longer detected.
Changes:
- Set
recommendationTypeIdtonullfor recommendation621dbc78-3745-4d32-8eac-9e65b27b7512, ensuring the collector includes it in its direct KQL query loop again.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview/Summary
The "Ensure Standard Load Balancer is zone-redundant" recommendation (
621dbc78-3745-4d32-8eac-9e65b27b7512) stopped detecting internal (private) load balancers with non-zone-redundant frontend IPs after PR #743 mapped it to Azure Advisor viarecommendationTypeId: 796b9be0-487d-4daa-8771-f08e4d7c9c0c.Root cause: The WARA collector skips direct KQL execution for any recommendation that has a non-null
recommendationTypeId, delegating detection to Azure Advisor instead. However, the corresponding Advisor recommendation does not cover internal/private load balancers — it only evaluates public-facing LBs. This means internal Standard LBs with zonal or no-zone frontend IPs are silently missed in assessment output.Fix: Set
recommendationTypeIdback tonullso the collector runs the existing KQL query directly against Azure Resource Graph, which correctly detects both internal and public LBs lacking zone-redundant frontend IPs.How the collector filters recommendations
In the WARA collector module (
collector.psm1,Invoke-WAFQueryLoop), the query loop applies this filter:Any recommendation with a non-null
recommendationTypeIdis excluded from KQL execution and instead routed to Advisor. Since Advisor doesn't cover internal LBs for this scenario, those resources go undetected.What the KQL query covers
The ARG query has two parts:
frontendIPConfigurationswith asubnet(private), flags those withzonesnull orarray_length(zones) < 2microsoft.network/publicipaddresses, flags public IPs withzonesnull orarray_length(zones) < 2Advisor only covers scenario 2. This change restores coverage for scenario 1.
Change
File:
azure-resources/Network/loadBalancers/recommendations.yamlRelated Issues/Work Items
Fixes the regression introduced in #743
Breaking Changes
As part of this pull request I have
mainbranch