[AKS] az aks nodepool update: Add --zones for automatic zone placement - #33976
[AKS] az aks nodepool update: Add --zones for automatic zone placement#33976Alex Huang (wenhug) wants to merge 3 commits into
az aks nodepool update: Add --zones for automatic zone placement#33976Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a preview --zones/-z argument to az aks nodepool update to enable migrating a regional AKS node pool to automatic zone placement (--zones auto) while preserving existing zones when the argument is omitted. To satisfy RP constraints, it scopes use of the 2026-01-02-preview API version to only the PUT update call when --zones is explicitly provided, keeping the initial GET and non-zones updates on the stable client.
Changes:
- Add
--zones/-z [Preview]toaz aks nodepool update(params + help) to support--zones autoand explicit zone lists. - Update the agentpool update decorator to apply
availability_zonesonly when--zonesis provided and to use the preview API version only for that PUT. - Add unit tests covering zone update behavior and verifying preview-client selection (and preserving custom resource clients).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_agentpool_decorator.py |
Adds unit tests for --zones update behavior and preview API selection logic. |
src/azure-cli/azure/cli/command_modules/acs/custom.py |
Adds zones parameter to the aks_agentpool_update command handler signature so it flows into raw parameters. |
src/azure-cli/azure/cli/command_modules/acs/agentpool_decorator.py |
Implements update_zones() and switches to a preview mgmt client only for PUT when --zones is set. |
src/azure-cli/azure/cli/command_modules/acs/_params.py |
Wires --zones/-z into aks nodepool update as a preview argument with updated help text. |
src/azure-cli/azure/cli/command_modules/acs/_help.py |
Documents --zones/-z for nodepool update and adds an example for --zones auto. |
src/azure-cli/azure/cli/command_modules/acs/_consts.py |
Introduces CONST_AGENTPOOL_UPDATE_ZONES_API_VERSION = "2026-01-02-preview". |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
az aks nodepool update: Add --zones for automatic zone placement
|
/azp run |
|
Commenter does not have sufficient privileges for PR 33976 in repo Azure/azure-cli |
|
AKS |
Live test results —
|
There was a problem hiding this comment.
Pass summary
All 53 CI checks passed and the live test dispatch reused a prior successful run for this head commit. The change is scoped to the acs module (agent pool parameter/decorator work) and includes a corresponding regression test update (test_agentpool_decorator.py, +169/-4), so there is no coverage gap. No review-skill findings were confirmed against the changed lines.
Risk assessment
17/100 · Low · High confidence
The Low rating is driven by public CLI behavior.
- Change scope: 6 changed files, 222 changed lines (
+216/-6), including 5 production files. - Affected components:
acs - Risk drivers: public CLI behavior (+18)
- Regression evidence: Changed regression tests are included, reducing risk.
- Confidence: High because changed-line patches were available for every production file.
- Required review: Owning-squad review is recommended for
acsbefore merge.
|
🔔 Routing this PR to @Azure/act-observability-squad. |
🤖 PR Validation —⚠️ Review suggested
Related command
az aks nodepool update --zones autoDescription
Adds the preview
--zones/-zargument toaz aks nodepool updateso a regional node pool can migrate to automatic zone placement. Omitted zones preserve the existing value.The RP rejects this property change on API versions before
2026-01-02-preview, so only a PUT with an explicitly supplied--zonesuses that preview API. The initial GET and node pool updates without--zonescontinue to use the normal stable client. Custom resource types such as aks-preview keep their own vendored preview client.Companion aks-preview extension PR: Azure/azure-cli-extensions#10248
Testing Guide
test_agentpool_decorator.pyandtest_custom.py).py_compileandgit diff --checkpassed.--zones autoand-z 1 2 3; source help exposes--zones -z [Preview].sysnpfromavailabilityZones: nullto["auto"]; the operation reachedSucceeded, and the replacement VMSS instance was placed in zone 1.History Notes
[AKS]
az aks nodepool update: Add--zones/-zto migrate a regional node pool to automatic zone placement.