Repository navigation
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
Yu Chen (jsntcy),
ZelinWang (wangzelin007) and
Yong Zhang (yonzhan)
October 16, 2026 15:23
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Container selection and alternate-target resolution have unresolved correctness issues, and snapshot restore paths lack focused tests.
3 open findings
What changed in this PR
Adds SQL instance snapshot backup and restore support to Azure CLI’s backup commands.
Changes:
- Adds snapshot protection, recovery-point filters, and restore configuration.
- Extends discovery and validation helpers, arguments, and examples.
- Upgrades the Recovery Services Backup SDK to 11.2.0.
| File | Description |
|---|---|
| src/azure-cli/requirements.py3.windows.txt | Updates Windows SDK pin. |
| src/azure-cli/requirements.py3.Linux.txt | Updates Linux SDK pin. |
| src/azure-cli/requirements.py3.Darwin.txt | Updates macOS SDK pin. |
| src/azure-cli/pyproject.toml | Updates SDK dependency requirement. |
| src/azure-cli/azure/cli/command_modules/backup/custom_wl.py | Implements snapshot protection and restore workflows. |
| src/azure-cli/azure/cli/command_modules/backup/custom_help.py | Extends polling, filtering, and JSON handling. |
| src/azure-cli/azure/cli/command_modules/backup/custom_common.py | Adds SQLInstance workload mappings. |
| src/azure-cli/azure/cli/command_modules/backup/custom_base.py | Routes new options to workload handlers. |
| src/azure-cli/azure/cli/command_modules/backup/_params.py | Exposes snapshot and discovery options. |
| src/azure-cli/azure/cli/command_modules/backup/_help.py | Documents snapshot commands and examples. |
| src/azure-cli/azure/cli/command_modules/backup/_client_factory.py | Adds discovery-status client factory. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| def register_wl_container(cmd, client, vault_name, resource_group_name, workload_type, resource_id, container_type): | ||
| def register_wl_container(cmd, client, vault_name, resource_group_name, workload_type, resource_id, container_type, | ||
| container_subscription_id=None): |
Comment on lines
+720
to
+722
| if (target_item_name is not None or | ||
| (restore_mode == 'AlternateWorkloadRestore' and | ||
| (recovery_mode is not None or workload_type == 'SQLInstance'))): |
| client_id=details.client_id, principal_id=details.principal_id)) | ||
|
|
||
|
|
||
| def _apply_sql_snapshot_restore(cmd, request, config, item, resource_group_name, vault_name): |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Collaborator
|
Please fix CI issues |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…changes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve SQL instance source-subscription discovery alongside Azure Files managed identity registration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Commenter does not have sufficient privileges for PR 34235 in repo Azure/azure-cli |
This branch has not been deployed
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 — ❌ Action needed
❌AzureCLI-FullTest
Related command
az backup container registeraz backup protection enable-for-azurewlaz backup policy create/az backup policy setaz backup recoverypoint list/az backup recoverypoint show-log-chainaz backup recoveryconfig showaz backup restore restore-azurewlDescription
Add SQL instance snapshot backup and restore support to the Backup command module using
azure-mgmt-recoveryservicesbackup==11.2.0, published from Azure/azure-sdk-for-python#49430.The new SQL snapshot paths are intended to preserve existing workload behavior. Full existing-workload playback validation is not yet passing; see Testing Guide below.
Testing Guide
Focused offline validation on Windows, using the repository-local Python environment:
Result: 31 passed, 27 subtests passed. The new
test_sql_instance.pyfile is currently local/untracked and will be added in a follow-up; this result is not yet reproducible from the PR checkout alone.Current CI results for commit
7c4d490fa94c9a8b6224411bf37475b9f4b863af:2026-10-01against recordings using2026-08-01. Recordings and any remaining SDK compatibility failures still need to be addressed.backup/custom_wl.py:598.Full live backup/restore scenarios have not been run as part of this validation. Existing-workload compatibility is not yet fully verified. After fixes, rerun the documented
azdev style backup,azdev linter backup --ci-exclusions, andazdev test backup --no-exitfirstchecks; these local azdev commands have not yet been rerun for this follow-up.History Notes
[Backup] Add SQL instance snapshot backup and restore support
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.