[dataprotection] Add autoprotection support for blob backup instances#9820
[dataprotection] Add autoprotection support for blob backup instances#9820Komla-Ansah wants to merge 4 commits intoAzure:mainfrom
Conversation
- Bump API version to 2026-03-01 for backup-instance create, update, validate-for-backup, and validate-for-update commands - Add --auto-protection and --exclusion-prefixes parameters to initialize-backupconfig for AzureBlob and AzureDataLakeStorage - Add get_blob_autoprotection_config helper with support for BlobBackupDatasourceParametersForAutoProtection and AdlsBlobBackupDatasourceParametersForAutoProtection object types - Add validation: auto-protection is mutually exclusive with --container-list and --include-all-containers - Add 9 unit tests covering positive and negative scenarios - Bump extension version to 1.10.0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| dataprotection backup-instance initialize-backupconfig | cmd dataprotection backup-instance initialize-backupconfig added parameter auto_protection_exclusion_prefixes |
||
| dataprotection backup-instance initialize-backupconfig | cmd dataprotection backup-instance initialize-backupconfig added parameter auto_protection |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
CodeGen Tools Feedback CollectionThank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey |
|
There was a problem hiding this comment.
Pull request overview
Adds auto-protection support for Azure Blob / ADLS backup-instance initialization in the dataprotection CLI extension, alongside an API version bump for backup-instance create/update/validate commands.
Changes:
- Bumped backup-instance create/update/validate-for-backup/validate-for-update to API version
2026-03-01. - Added
--auto-protectionand--exclusion-prefixestoaz dataprotection backup-instance initialize-backupconfigforAzureBlobandAzureDataLakeStorage, including mutual-exclusion validation. - Added scenario tests covering auto-protection configurations and invalid argument combinations; bumped extension version to
1.10.0.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dataprotection/setup.py | Bumps extension package version to 1.10.0. |
| src/dataprotection/HISTORY.rst | Adds release notes entry for 1.10.0. |
| src/dataprotection/azext_dataprotection/manual/helpers.py | Adds helper to generate blob auto-protection backupconfig payload. |
| src/dataprotection/azext_dataprotection/manual/custom.py | Wires new auto-protection args into initialize-backupconfig and adds validation. |
| src/dataprotection/azext_dataprotection/manual/_params.py | Adds CLI parameters --auto-protection and --exclusion-prefixes. |
| src/dataprotection/azext_dataprotection/manual/_help.py | Adds help examples for auto-protection usage. |
| src/dataprotection/azext_dataprotection/tests/latest/test_dataprotection_configs.py | Adds tests for auto-protection config output and invalid arg combos. |
| src/dataprotection/azext_dataprotection/aaz/latest/dataprotection/backup_instance/_create.py | API version bump + schema additions for auto-protection settings. |
| src/dataprotection/azext_dataprotection/aaz/latest/dataprotection/backup_instance/_update.py | API version bump + schema additions for auto-protection settings. |
| src/dataprotection/azext_dataprotection/aaz/latest/dataprotection/backup_instance/_validate_for_backup.py | API version bump + schema additions for auto-protection settings. |
| src/dataprotection/azext_dataprotection/aaz/latest/dataprotection/backup_instance/_validate_for_update.py | API version bump + schema additions for auto-protection settings. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
zubairabid
left a comment
There was a problem hiding this comment.
The changes overall seem okay, but there's a potential bug. Please check that.
…alidation - Use 'is not None' instead of truthiness for auto_protection and auto_protection_exclusion_prefixes in AKS validation - Use 'is not None' for include_all_containers in auto-protection mutual exclusion check - Fix RST underline length for 1.10.0 in HISTORY.rst Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
The initialize-backupconfig command uses cf_blob_container_mgmt client factory which requires Azure login. This causes test failures in CI where no auth is available. Tests pass locally with az login. Same pattern as existing AKS config test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Commenter does not have sufficient privileges for PR 9820 in repo Azure/azure-cli-extensions |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Description
Adds autoprotection support for blob backup instances in the \dataprotection\ CLI extension.
Changes
Testing
Related