Skip to content

 {AKS} az aks maintenanceconfiguration: Add --maintenance-window-id to link a shared MaintenanceWindow  - #10090

Open
anushkasingh16 wants to merge 3 commits into
Azure:mainfrom
anushkasingh16:anushkasingh/add-maintenanceWindowId-to-mtc
Open

 {AKS} az aks maintenanceconfiguration: Add --maintenance-window-id to link a shared MaintenanceWindow #10090
anushkasingh16 wants to merge 3 commits into
Azure:mainfrom
anushkasingh16:anushkasingh/add-maintenanceWindowId-to-mtc

Conversation

@anushkasingh16

@anushkasingh16 anushkasingh16 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes
⚠️ None
⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd aks maintenanceconfiguration add cmd aks maintenanceconfiguration add added parameter maintenance_window_id
⚠️ 1006 - ParaAdd aks maintenanceconfiguration update cmd aks maintenanceconfiguration update added parameter maintenance_window_id

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 vendored SDK flattening maintenance_window_id (maintenanceWindowId) onto MaintenanceConfiguration. This shipped in the 2026-05-02-preview SDK refresh (vendored via #10143); the branch has been rebuilt on top of it, so no vendored_sdks changes 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

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

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.json automatically.
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.

… 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>
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jul 8, 2026

Copy link
Copy Markdown
⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd aks maintenanceconfiguration add cmd aks maintenanceconfiguration add added parameter maintenance_window_id
⚠️ 1006 - ParaAdd aks maintenanceconfiguration update cmd aks maintenanceconfiguration update added parameter maintenance_window_id

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @anushkasingh16,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan

yonzhan commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

AKS

@a0x1ab

a0x1ab commented Jul 27, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
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
anushkasingh16 marked this pull request as ready for review July 27, 2026 22:43
Copilot AI review requested due to automatic review settings July 27, 2026 22:43
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

a0x1ab commented Jul 27, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-id to aks maintenanceconfiguration add and update, and construct a MaintenanceConfiguration that references a shared MaintenanceWindow.
  • Enforce mutual exclusivity between --maintenance-window-id and inline schedule arguments; add unit tests and CLI help/examples.
  • Bump extension version to 21.0.0b12 and document the change in HISTORY.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-id should 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on this

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 here as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants