-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Update immutable ltr ga #28735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update immutable ltr ga #28735
Conversation
Merge main repo into fork
…k the new cmdlets to add PassThru parameter which returns LTR backup model object.
…-2024-11-01-preview
https://github.com/brandong-ms/azure-powershell into update-sql-powershell-for-rest-api-2024-11-01-preview
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for immutable Long-Term Retention (LTR) backups in Azure SQL, introducing time-based and legal hold immutability features. The implementation includes new cmdlets for managing immutability policies, updated existing cmdlets to expose immutability parameters, and comprehensive documentation.
Key Changes:
- Added four new cmdlets for managing LTR backup immutability (Lock, Remove, Set Legal Hold, Remove Legal Hold)
- Extended existing models to include immutability properties (TimeBasedImmutability, TimeBasedImmutabilityMode, LegalHoldImmutability)
- Updated Set-AzSqlDatabaseBackupLongTermRetentionPolicy to support immutability parameters
Reviewed Changes
Copilot reviewed 25 out of 64 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Sql/Sql/help/*.md | Added/updated help documentation for immutability cmdlets and properties |
| src/Sql/Sql/Properties/Resources.resx | Added user-facing warning and description strings for immutability operations |
| src/Sql/Sql/Database Backup/Services/*.cs | Implemented communicator and adapter methods for immutability API calls |
| src/Sql/Sql/Database Backup/Model/*.cs | Extended models with immutability properties |
| src/Sql/Sql/Database Backup/Cmdlet/*.cs | Implemented new cmdlets and updated existing policy cmdlet |
| src/Sql/Sql/Common/DatabaseBackupConstants.cs | Added constants for immutability values |
| src/Sql/Sql/ChangeLog.md | Documented changes for upcoming release |
| src/Sql/Sql/Az.Sql.psd1 | Exported new cmdlets |
| src/Sql/Sql.Test/SessionRecords/*.json | Added test recordings |
| src/Sql/Sql.Test/ScenarioTests/DatabaseBackupTests.cs | Added test methods for immutability features |
| src/Sql/Sql.Management.Sdk/README.md | Updated API spec references to 2024-11-01-preview |
Files not reviewed (1)
- src/Sql/Sql/Properties/Resources.Designer.cs: Language not supported
| - Updated `AzureSqlDatabaseBackupLongTermRetentionPolicyModel` to add `TimeBasedImmutability` and `TimeBasedImmutabilityMode` properties. | ||
| - Updated `AzureSqlDatabaseLongTermRetentionBackupModel` to add `TimeBasedImmutability`, `TimeBasedImmutabilityMode`, and `LegalHoldImmutability` properties. | ||
| - Added new cmdlets `Lock-AzSqlDatabaseLongTermRetentionBackupImmutability` and `Remove-AzSqlDatabaseLongTermRetentionBackupImmutability` for managing time-based immutability on LTR backups. | ||
| - Added new cmdlets `Set-Az SqlDatabaseLongTermRetentionBackupLegalHold` and `Remove-AzSqlDatabaseLongTermRetentionBackupLegalHold` for managing legal hold immutability on LTR backups. |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an extra space in the cmdlet name. It should be "Set-AzSqlDatabaseLongTermRetentionBackupLegalHold" not "Set-Az SqlDatabaseLongTermRetentionBackupLegalHold".
| - Added new cmdlets `Set-Az SqlDatabaseLongTermRetentionBackupLegalHold` and `Remove-AzSqlDatabaseLongTermRetentionBackupLegalHold` for managing legal hold immutability on LTR backups. | |
| - Added new cmdlets `Set-AzSqlDatabaseLongTermRetentionBackupLegalHold` and `Remove-AzSqlDatabaseLongTermRetentionBackupLegalHold` for managing legal hold immutability on LTR backups. |
| WeekOfYear : 26 | ||
| Location : | ||
| TimeBasedImmutability : Enabled | ||
| TimeBasedImmutabilityMode : Unlocked |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example output shows TimeBasedImmutabilityMode as "Unlocked" when the command explicitly sets -TimeBasedImmutabilityMode Locked. This is inconsistent with the command being executed.
| TimeBasedImmutabilityMode : Unlocked | |
| TimeBasedImmutabilityMode : Locked |
| ### -DatabaseName | ||
| The name of the Azure SQL Database the backup is from. | ||
| The name of the Azure SQL Server the backups are under. |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for -DatabaseName parameter is incorrect. It states "The name of the Azure SQL Server the backups are under" but should describe the database name, not the server name. The ServerName parameter already describes the server.
| The name of the Azure SQL Server the backups are under. | |
| The name of the Azure SQL database the backups are under. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM. When you refresh the help documents make sure to add -RefreshModulePage to update the index doc Az.Sql.md as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the new entries below "#Upcoming Release“
|
This PR was labeled "needs-revision" because it has unresolved review comments or CI failures. |
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.