Fix load balancing sample - #272
Merged
Merged
Conversation
Simon Kurtz (simonkurtz-MSFT)
commented
Aug 27, 2026
Member
- Fix load-balancing policy XML
- Log debug info error information details
🐍 Python 3.14 Results
|
🐍 Python 3.12 Results
|
🐍 Python 3.13 Results
|
Copilot started reviewing on behalf of
Simon Kurtz (simonkurtz-MSFT)
August 27, 2026 19:35
View session
There was a problem hiding this comment.
Pull request overview
This PR fixes the load-balancing sample’s retry-tracking policy XML so it emits valid C# string literals (avoiding invalid multi-character character literals), and improves Azure CLI/ARM failure diagnostics by preferring nested ARM error detail messages while also updating legacy diagnostic-setting cleanup matching.
Changes:
- Updated the load-balancing retry-tracked policy to use double-quoted C# string literals inside APIM policy expressions, with XML-safe quoting.
- Adjusted ARM error detail extraction to prefer nested
details/innererrormessages over top-level messages for better diagnostics. - Expanded legacy APIM diagnostic-setting migration matching (including
apim-diag) and updated tests accordingly, plus added XML well-formedness validation for rendered policies.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/python/test_load_balancing_helpers.py | Adds policy XML parsing validation and asserts retry-tracking policy uses C# string literals. |
| tests/python/test_azure_resources.py | Updates legacy diagnostic-setting migration test cases to include apim-diag and expected delete calls. |
| tests/python/test_azure_resources_run.py | Updates ARM error extraction test payload to ensure nested details are preferred even when a top-level message exists. |
| shared/python/azure_resources.py | Expands legacy diagnostic-setting name matching and changes ARM error extraction ordering to prefer nested details/innererror. |
| samples/load-balancing/apim-policies/aca-backend-pool-load-balancing-with-retry-tracked.xml | Fixes quoting in policy expressions to avoid invalid C# char literals and keep XML attributes well-formed. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.