SQL az sql db: add LTR Immutability Operations#31905
SQL az sql db: add LTR Immutability Operations#31905lixiachena wants to merge 68 commits intoAzure:devfrom
Conversation
❌AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
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>
|
There was a problem hiding this comment.
Pull Request Overview
This PR updates Azure SQL functionality to support Long-Term Retention (LTR) immutability operations by upgrading the azure-mgmt-sql library and adding new commands for managing backup immutability settings.
Key changes include:
- Upgrade azure-mgmt-sql dependency to version 4.0.0b22
- Addition of four new commands for LTR backup immutability operations
- Update of existing LTR policy command with new parameter naming and functionality
Reviewed Changes
Copilot reviewed 12 out of 83 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/azure-cli/setup.py | Updates azure-mgmt-sql version from 4.0.0b21 to 4.0.0b22 |
| src/azure-cli/requirements.py3.*.txt | Updates azure-mgmt-sql dependency version across all platform requirement files |
| test_sql_commands.py | Adds comprehensive test suite for new LTR immutability operations and updates existing tests |
| test_sql_*.yaml | Updates test recordings to reflect API version changes and new functionality |
| 'yearly_retention': 'P2M', | ||
| 'week_of_year': 12, | ||
| 'make_backups_immutable': 'False', | ||
| 'time_based_mmutability': 'False', |
There was a problem hiding this comment.
The variable name 'time_based_mmutability' contains a typo. It should be 'time_based_immutability' to match the intended functionality.
| 'time_based_mmutability': 'False', | |
| 'time_based_immutability': 'False', |
| ' --weekly-retention {weekly_retention} --monthly-retention {monthly_retention}' | ||
| ' --yearly-retention {yearly_retention} --week-of-year {week_of_year}' | ||
| ' --make-backups-immutable {make_backups_immutable}', | ||
| ' --time-based-immutability {time_based_immutability}', |
There was a problem hiding this comment.
The test is referencing '{time_based_immutability}' which is not defined in the kwargs for this test. Based on the typo in line 1385, this should reference '{time_based_mmutability}' or the typo should be fixed.
| self.check('monthlyRetention', '{monthly_retention}'), | ||
| self.check('yearlyRetention', '{yearly_retention}'), | ||
| self.check('makeBackupsImmutable', '{make_backups_immutable}')]) | ||
| self.check('timeBasedImmutability', '{time_based_immutability}')]) |
There was a problem hiding this comment.
The assertion is checking for '{time_based_immutability}' which is not defined in the test's kwargs. This will cause the test to fail.
| self.check('monthlyRetention', '{monthly_retention}'), | ||
| self.check('yearlyRetention', '{yearly_retention}'), | ||
| self.check('makeBackupsImmutable', '{make_backups_immutable}')]) | ||
| self.check('timeBasedImmutability', '{time_based_immutability}')]) |
There was a problem hiding this comment.
The assertion is checking for '{time_based_immutability}' which is not defined in the test's kwargs. This will cause the test to fail.
| self.check('name', '{backup_name}')]) | ||
|
|
||
| self.check('name', '{backup_name}'), | ||
| self.check('timeBasedImmutability', '{time_based_immutability}')]) |
There was a problem hiding this comment.
The assertion is referencing '{time_based_immutability}' but the variable is defined as '{time_based_mmutability}' (with typo) in the kwargs. This will cause the test to fail.
…nto Bump_azure_mgmt_sql_version_400b22
…SSD V2 is no longer supported with Burstable compute tier (Azure#31948)
…rate CV1 apps to Flex (Azure#31865)
|
Create a new PR since this PR merged so many times and merged files are incorrect |
Related command
This changeset includes
Update azure-mgmt-sql to 4.0.0b22
Add new commands:
Modified command .az sql db ltr-policy set
Description
This is to support sql Immutability LTR public review feature
Testing Guide
Set LTR policy with new parmater
az sql db ltr-policy set --name cli_test_donnotdelete2 --resource-group cli_test_donnotdelete --server clitestserverdonotdeletecanaryeast --time-based-immutability Enabled --subscription 4aebc079-5ec8-4be9-9f4d-39c38f3707cc ---time-based-immutability Locked -weekly-retention P1w
Set legal hold
az sql db ltr-backup set_legal_hold_immutability -d db1 -s lichcanaryus2 -l eastus2euap --n "f05281db-0c65-42ad-8f54-d259dd7be6e8;133983855330000000;Hot"
Remove legalhold
az sql db ltr-backup remove_legal_hold_immutability -d db1 -s lichcanaryus2 -l eastus2euap --n "f05281db-0c65-42ad-8f54-d259dd7be6e8;133983855330000000;Hot"
Disable time based immutability
az sql db ltr-backup disable-time-based-immutability -d db1 -s lichcanaryus2 -l eastus2euap --n "f05281db-0c65-42ad-8f54-d259dd7be6e8;133983855330000000;Hot"
Lock time based immutability
az sql db ltr-backup lock-time-based-immutability -d db1 -s lichcanaryus2 -l eastus2euap --n "f05281db-0c65-42ad-8f54-d259dd7be6e8;133983855330000000;Hot"
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.