{AKS} az aks maintenanceconfiguration: Add --maintenance-window-id to link a shared MaintenanceWindow - #10090
Open
anushkasingh16 wants to merge 3 commits into
Open
Conversation
… link a shared MaintenanceWindow Add support for the maintenanceWindowId field on the maintenance configuration body. A non-null value points the configuration at a shared MaintenanceWindow ARM resource (from the recent maintenancewindow CRUD commands); when omitted there is no shared resource. - Add --maintenance-window-id to `aks maintenanceconfiguration add/update`, usable with any config name. - Make it mutually exclusive with all inline schedule arguments, since the schedule then lives in the referenced MaintenanceWindow resource. - Add help text, examples, unit tests and a HISTORY entry. Note: relies on the regenerated SDK flattening `maintenance_window_id` (maintenanceWindowId) onto MaintenanceConfiguration; vendored_sdks are intentionally left untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| aks maintenanceconfiguration add | cmd aks maintenanceconfiguration add added parameter maintenance_window_id |
||
| aks maintenanceconfiguration update | cmd aks maintenanceconfiguration update added parameter maintenance_window_id |
|
Hi @anushkasingh16, |
microsoft-github-policy-service
Bot
requested review from
FumingZhang,
yanzhudd and
yonzhan
July 8, 2026 23:23
Collaborator
|
AKS |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
The 21.0.0b11 version was consumed by the 2026-05-02-preview SDK vendor (Azure#10143) and is already released, so the new --maintenance-window-id command change needs its own version. Bump setup.py to 21.0.0b12 and move the HISTORY entry out of Pending under the new 21.0.0b12 heading.
anushkasingh16
marked this pull request as ready for review
July 27, 2026 22:43
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the aks-preview Azure CLI extension to support linking AKS maintenance configurations to a shared MaintenanceWindow ARM resource via a new --maintenance-window-id argument on az aks maintenanceconfiguration add/update, with validation to prevent mixing shared-window linkage with inline schedule flags.
Changes:
- Add
--maintenance-window-idtoaks maintenanceconfiguration addandupdate, and construct aMaintenanceConfigurationthat references a shared MaintenanceWindow. - Enforce mutual exclusivity between
--maintenance-window-idand inline schedule arguments; add unit tests and CLI help/examples. - Bump extension version to
21.0.0b12and document the change inHISTORY.rst.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/aks-preview/setup.py | Bumps extension version to 21.0.0b12. |
| src/aks-preview/HISTORY.rst | Adds release notes describing --maintenance-window-id. |
| src/aks-preview/azext_aks_preview/tests/latest/test_maintenanceconfiguration.py | Adds unit tests for the new shared MaintenanceWindow linking and conflicts with inline schedule flags. |
| src/aks-preview/azext_aks_preview/maintenanceconfiguration.py | Adds shared MaintenanceWindow construction path and inline-schedule conflict detection. |
| src/aks-preview/azext_aks_preview/custom.py | Adds maintenance_window_id parameter plumbing to add/update handlers via locals(). |
| src/aks-preview/azext_aks_preview/_params.py | Adds the new CLI argument definition and help text. |
| src/aks-preview/azext_aks_preview/_help.py | Documents the new parameter and provides add/update examples. |
Comments suppressed due to low confidence (1)
src/aks-preview/azext_aks_preview/_help.py:1892
- Help text for
--maintenance-window-idshould mention it cannot be combined with--config-file(otherwise the CLI may ignore one of the inputs, depending on implementation).
- name: --maintenance-window-id
type: string
short-summary: Resource ID of a shared MaintenanceWindow resource to link this maintenance configuration to. When set, the schedule lives in the referenced MaintenanceWindow and inline schedule arguments cannot be used. Omit for no shared resource.
Comment on lines
45
to
49
| if config_file is not None: | ||
| mcr = get_file_json(config_file) | ||
| logger.info(mcr) | ||
| return mcr | ||
|
|
Comment on lines
+2799
to
+2804
| help=( | ||
| "Resource ID of a shared MaintenanceWindow resource to link this maintenance " | ||
| "configuration to. When set, the schedule lives in the referenced MaintenanceWindow " | ||
| "and inline schedule arguments cannot be used. Omit for no shared resource." | ||
| ), | ||
| ) |
Comment on lines
+1749
to
+1751
| - name: --maintenance-window-id | ||
| type: string | ||
| short-summary: Resource ID of a shared MaintenanceWindow resource to link this maintenance configuration to. When set, the schedule lives in the referenced MaintenanceWindow and inline schedule arguments cannot be used. Omit for no shared resource. |
ibaboulfetouh
approved these changes
Jul 28, 2026
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.
🤖 PR Validation —⚠️ Review suggested
Add support for the maintenanceWindowId field on the maintenance configuration body. A non-null value points the configuration at a shared MaintenanceWindow ARM resource (from the recent maintenancewindow CRUD commands); when omitted there is no shared resource.
aks maintenanceconfiguration add/update, usable with any config name.Note: relies on the vendored SDK flattening
maintenance_window_id(maintenanceWindowId) onto MaintenanceConfiguration. This shipped in the2026-05-02-previewSDK refresh (vendored via #10143); the branch has been rebuilt on top of it, so novendored_sdkschanges are required in this PR.This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az aks maintenanceconfiguration add/az aks maintenanceconfiguration update(--maintenance-window-id)General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.