Edit

Share via


Remove-AzSqlDatabaseLongTermRetentionBackupImmutability

Removes an unlocked time-based immutability policy for an LTR backup.

Syntax

RemoveBackupImmutabilityDefault (Default)

Remove-AzSqlDatabaseLongTermRetentionBackupImmutability
    [-Location] <String>
    [-ServerName] <String>
    [-DatabaseName] <String>
    [-BackupName] <String>
    [-ResourceGroupName <String>]
    [-Force]
    [-PassThru]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RemoveBackupImmutabilityByInputObject

Remove-AzSqlDatabaseLongTermRetentionBackupImmutability

    [-InputObject] <AzureSqlDatabaseLongTermRetentionBackupModel>
    [-Force]
    [-PassThru]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RemoveBackupImmutabilityByResourceId

Remove-AzSqlDatabaseLongTermRetentionBackupImmutability
    [-ResourceId] <String>
    [-Force]
    [-PassThru]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The cmdlet Remove-AzSqlDatabaseLongTermRetentionBackupImmutability permanently removes an unlocked time-based immutability policy for the backup. Once removed, the backup will be able to be deleted manually. It is not possible to re-add time-based immutability once it is removed (however, a legal hold can always be applied).

Examples

Example 1: Remove the time-based immutability policy for a single backup.

Remove-AzSqlDatabaseLongTermRetentionBackupImmutability -Location northeurope -ServerName server01 -DatabaseName testdb2 -BackupName "601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000" -PassThru
BackupExpirationTime      : 8/5/2025 8:23:33 PM
BackupName                : 601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
BackupTime                : 7/29/2025 8:23:33 PM
DatabaseName              : testdb2
DatabaseDeletionTime      :
Location                  : northeurope
ResourceId                : /subscriptions/b75889fa-6661-44e0-a844-cd96ec938991/resourceGroups/resourcegroup01/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server01/longTermRetentionDatabases/testdb2/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
ServerName                : server01
ServerCreateTime          : 7/29/2025 7:28:46 PM
ResourceGroupName         : resourcegroup01
BackupStorageRedundancy   : Geo
TimeBasedImmutability     : Disabled
TimeBasedImmutabilityMode : Unlocked
LegalHoldImmutability     : Disabled

This removes the time-based immutability policy for the backup "601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000". Note that a prerequisite to this operation is that the backup has TimeBasedImmutability set to "Enabled" and TimeBasedImmutabilityMode set to "Unlocked".

Parameters

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-BackupName

The name of the backup.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveBackupImmutabilityDefault
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DatabaseName

The name of the Azure SQL Database the backup is from.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveBackupImmutabilityDefault
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Skip confirmation message for performing the action

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

The Database Long Term Retention Backup for which to remove time-based immutability.

Parameter properties

Type:AzureSqlDatabaseLongTermRetentionBackupModel
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveBackupImmutabilityByInputObject
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Location

The ___location of the backups' source server.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveBackupImmutabilityDefault
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

Whether to output the model at the end of execution

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The name of the resource group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveBackupImmutabilityDefault
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceId

The Resource ID of the Database Long Term Retention Backup for which to remove time-based immutability

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveBackupImmutabilityByResourceId
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ServerName

The name of the Azure SQL Server the backup is under.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveBackupImmutabilityDefault
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

AzureSqlDatabaseLongTermRetentionBackupModel

String

Outputs

AzureSqlDatabaseLongTermRetentionBackupModel