Skip to content

[AKS] az aks maintenanceconfiguration add/update: Add support for maintenanceWindow format in default maintenance configuration#33431

Open
anushkasingh16 wants to merge 2 commits into
Azure:devfrom
anushkasingh16:anushkasingh/default-mtc-maintenancewindow
Open

[AKS] az aks maintenanceconfiguration add/update: Add support for maintenanceWindow format in default maintenance configuration#33431
anushkasingh16 wants to merge 2 commits into
Azure:devfrom
anushkasingh16:anushkasingh/default-mtc-maintenancewindow

Conversation

@anushkasingh16
Copy link
Copy Markdown
Contributor

@anushkasingh16 anushkasingh16 commented May 22, 2026

Related command
az aks maintenanceconfiguration add
az aks maintenanceconfiguration update

Description
Previously, the default maintenance configuration only supported the legacy timeInWeek format (using --weekday and --start-hour).
The AKS RP API (since 2023-05-01) also supports the maintenanceWindow format for the default config, but the CLI was blocking it by raising an error when --schedule-type was provided for the default config.

This PR removes that restriction and allows users to use --schedule-type Weekly with the default maintenance configuration name, which routes to the maintenanceWindow format. The RP enforces that only Weekly schedule with intervalWeeks=1 is valid for the default config (since API version 2025-03-01), so the CLI validates this client-side as well.

The legacy --weekday --start-hour path continues to work unchanged for backward compatibility.

Testing Guide

# New: Create default maintenance config using maintenanceWindow format
az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name myCluster \
  -n default --schedule-type Weekly --day-of-week Monday --interval-weeks 1 \
  --duration 4 --start-time 09:00

# Still works: Legacy timeInWeek format
az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name myCluster \
  -n default --weekday Monday --start-hour 1

# Error: Invalid schedule type for default (only Weekly allowed)
az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name myCluster \
  -n default --schedule-type Daily --interval-days 3 --duration 4 --start-time 09:00

# Error: Cannot mix --weekday/--start-hour with --schedule-type
az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name myCluster \
  -n default --weekday Monday --start-hour 1 --schedule-type Weekly

History Notes

[AKS] az aks maintenanceconfiguration add/update: Add --schedule-type Weekly support for default maintenance configuration using the maintenanceWindow format


This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI review requested due to automatic review settings May 22, 2026 22:05
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented May 22, 2026

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @anushkasingh16,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented May 22, 2026

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Enable --schedule-type (Weekly-only) for the default AKS maintenance configuration using the maintenanceWindow format, and update CLI help/docs and tests accordingly.

Changes:

  • Allow --schedule-type Weekly for default maintenance configuration and construct maintenance_window payload.
  • Add negative tests validating default-config argument constraints for --schedule-type and --interval-weeks.
  • Update parameter/help text and add CLI examples for default maintenanceWindow schedules.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/azure-cli/azure/cli/command_modules/acs/maintenanceconfiguration.py Adds schedule_type handling for default config and builds maintenance_window model
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_maintenanceconfiguration.py Updates/extends tests for default config schedule-type validation
src/azure-cli/azure/cli/command_modules/acs/_params.py Clarifies --schedule-type help now that default supports Weekly
src/azure-cli/azure/cli/command_modules/acs/_help.py Adds examples and updates help text to mention default Weekly-only support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/azure-cli/azure/cli/command_modules/acs/maintenanceconfiguration.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/acs/maintenanceconfiguration.py Outdated
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 22, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Comment thread src/azure-cli/azure/cli/command_modules/acs/_help.py
@yewmsft
Copy link
Copy Markdown
Member

yewmsft commented May 23, 2026

nit: validation gap — for default config with --schedule-type Weekly, you reject interval_weeks != 1 but pass other maintenanceWindow params (utc_offset, not_allowed_dates, start_date) through to constructMaintenanceWindow unchecked. if the RP rejects those for the default config (or silently ignores them), the user gets a confusing failure / wrong behavior. either enumerate the supported subset and reject the rest up-front with a clear error, or confirm the RP-side surface and document it in _help.py.

also the example text says "in UTC every week" but the maintenanceWindow path supports --utc-offset. clarify whether default-config maintenanceWindow honors offset or ignores it.

@FumingZhang
Copy link
Copy Markdown
Member

FumingZhang commented May 25, 2026

@anushkasingh16 anushkasingh16 changed the title [AKS] az aks maintenanceconfiguration add/update: Add support for maintenanceWindow format in default maintenance configuration [AKS] az aks maintenanceconfiguration add/update: Add support for maintenanceWindow format in default maintenance configuration May 25, 2026
@FumingZhang
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

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

Labels

act-observability-squad AKS az aks/acs/openshift Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants