[Compute] Fix #34063: az vmss update: Clear the stale zone placement filter when switching filters - #34064
Open
WhaleTech (ryo-whaletech) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
Julie Zhu (yanzhudd) and
Yong Zhang (yonzhan)
September 11, 2026 06:46
Contributor
|
Thank you for your contribution WhaleTech (@ryo-whaletech)! We will review the pull request and get back to you soon. |
Copilot started reviewing on behalf of
WhaleTech (ryo-whaletech)
September 11, 2026 06:46
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation and regression coverage address both filter-switching directions with no unresolved blocking issues.
Pull request overview
Fixes az vmss update so switching VMSS zone placement filters clears stale, mutually exclusive state.
Changes:
- Normalize include/exclude zone filter updates.
- Add regression coverage for both transition directions.
File summaries
| File | Summary |
|---|---|
src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py |
Verifies both filter-switching scenarios. |
src/azure-cli/azure/cli/command_modules/vm/custom.py |
Clears the opposite placement filter before updating. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Collaborator
|
Compute |
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.
Related command
az vmss updateDescription
Fixes #34063
When a VMSS already contains
placement.includeZonesorplacement.excludeZones, generic update loads and preserves that existing property.If the user supplies the opposite argument, the existing implementation adds the new filter without removing the old one. The complete model passed to the AAZ VMSS create-or-update operation therefore contains both mutually exclusive properties, which Compute rejects.
This change normalizes placement state in the legacy
update_vmsscustomization:--include-zonesremoves a persistedexcludeZones.--exclude-zonesremoves a persistedincludeZones.The regression test exercises both transition directions and inspects the exact model passed to
VMSSCreate.The fix belongs in the Azure CLI custom update handler because it depends on distinguishing persisted generic-update state from an explicitly supplied CLI argument. The generated AAZ schema and PUT serializer correctly represent both service properties and do not require modification.
Feature-introduction context: #33639.
Testing Guide
Focused regression:
Result:
1 passed, 2 subtests passed.Relevant unit module:
Result:
8 passed, 2 subtests passed.Existing update playback:
Result:
1 passed.Related include/exclude/conflict playback tests:
Result:
3 passed.VIRTUAL_ENV="$PWD/.venv" \ AZDEV_CONFIG_DIR=/private/tmp/azure-cli-azdev \ .venv/bin/azdev style vmResult: Pylint and Flake8 passed.
VIRTUAL_ENV="$PWD/.venv" \ AZDEV_CONFIG_DIR=/private/tmp/azure-cli-azdev \ .venv/bin/azdev linter vmResult: passed with no violations.
Result: passed.
The full
azdev test vmsuite and a live Azure VMSS transition were not run. No recordings were regenerated.History Notes
[Compute]
az vmss update: Fix switching between--include-zonesand--exclude-zoneswhen the opposite zone placement filter is already configuredThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.