Skip to content

[aks-preview] Add --enable-backup to az aks create and az aks update#9897

Draft
anshulahuja98 wants to merge 6 commits into
Azure:mainfrom
anshulahuja98:feat/aks-enable-backup
Draft

[aks-preview] Add --enable-backup to az aks create and az aks update#9897
anshulahuja98 wants to merge 6 commits into
Azure:mainfrom
anshulahuja98:feat/aks-enable-backup

Conversation

@anshulahuja98
Copy link
Copy Markdown
Contributor

@anshulahuja98 anshulahuja98 commented May 25, 2026


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

Related command

az aks create / az aks update

Adds three new arguments to both commands that orchestrate the same flow as az dataprotection enable-backup trigger:

--enable-backup
--backup-strategy {Week | Month | DisasterRecovery | Custom}
--backup-configuration-file <@file.json | inline json>

The backup orchestration (resource group, storage account, blob container, k8s extension install, backup vault, backup policy, trusted access role binding, RBAC role assignments, backup instance) is delegated to the existing helper in the dataprotection CLI extension. The aks-preview side is a thin shim that loads the dataprotection extension lazily, raises an actionable error when it is not installed, and derives the AKS datasource ARM id from -g / -n. The call is wired into the create and update decorators' postprocessing_after_mc_created path so backup is only configured after the cluster mutation succeeds.

Companion to the merged dataprotection-side change: #9701 — Enable Backup Command for AKS in dataprotection CLI (which added az dataprotection enable-backup trigger; this PR surfaces the same flow as a flag on az aks create / az aks update).

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 wheel==0.30.0 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.

Adds three new arguments to both 'az aks create' and 'az aks update' that orchestrate the same flow as 'az dataprotection enable-backup trigger':

  --enable-backup

  --backup-strategy {Week|Month|DisasterRecovery|Custom}

  --backup-configuration-file

The backup orchestration (vault, policy, storage account, k8s extension install, trusted access, role assignments, backup instance creation) is delegated to the 'dataprotection' CLI extension via a thin shim (aks_backup.py) that imports the helper lazily. If the dataprotection extension is not installed, an actionable error is raised.

Wired into both create and update decorators via the postprocessing_after_mc_created path so backup runs only after the cluster mutation succeeds.
@azure-client-tools-bot-prd
Copy link
Copy Markdown

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

⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd aks create cmd aks create added parameter backup_configuration_file
⚠️ 1006 - ParaAdd aks create cmd aks create added parameter backup_strategy
⚠️ 1006 - ParaAdd aks create cmd aks create added parameter enable_backup
⚠️ 1006 - ParaAdd aks update cmd aks update added parameter backup_configuration_file
⚠️ 1006 - ParaAdd aks update cmd aks update added parameter backup_strategy
⚠️ 1006 - ParaAdd aks update cmd aks update added parameter enable_backup

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

Hi @anshulahuja98,
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
Copy link
Copy Markdown
Collaborator

yonzhan commented May 25, 2026

aks

Anshul Ahuja added 2 commits May 25, 2026 15:34
- Rename --backup-configuration-file to --backup-configuration (drops the misleading -file suffix; the validator accepts both @file.json and inline JSON). Also resolves option_length_too_long (HIGH).

- Silence too-many-boolean-expressions in the update decorator's check_is_postprocessing_required, matching the existing pylint-disable already used in the create decorator's equivalent block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants