Remove-AzSqlDatabaseLongTermRetentionBackup
Deletes a long term retention backup.
Syntax
RemoveBackupDefault (Default)
Remove-AzSqlDatabaseLongTermRetentionBackup
[-Location] <String>
[-ServerName] <String>
[-DatabaseName] <String>
[-BackupName] <String>
[-ResourceGroupName <String>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzSqlDatabaseLongTermRetentionBackup
[-InputObject] <AzureSqlDatabaseLongTermRetentionBackupModel>
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
RemoveBackupByResourceId
Remove-AzSqlDatabaseLongTermRetentionBackup
[-ResourceId] <String>
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-AzSqlDatabaseLongTermRetentionBackup cmdlet deletes the backup specified.
Examples
Example 1: Delete a single backup with resource group
Remove-AzSqlDatabaseLongTermRetentionBackup -Location northeurope -ServerName server01 -DatabaseName database01 -BackupName "601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000" -ResourceGroupName resourcegroup01
BackupExpirationTime : 3/22/2018 5:50:55 AM
BackupName : 601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
BackupTime : 3/15/2018 5:50:55 AM
DatabaseName : database01
DatabaseDeletionTime :
Location : northeurope
ResourceId : /subscriptions/371edd6d-9630-4558-a7bd-ee139498e6a1/resourceGroups/resourcegroup01/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server01/longTermRetentionDatabases/database01/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
ServerName : server01
ServerCreateTime : 2/29/2018 12:12:19 AM
Deletes the backup with name 601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
Example 2: Delete a single backup without resource group
Remove-AzSqlDatabaseLongTermRetentionBackup -Location northeurope -ServerName server02 -DatabaseName database02 -BackupName "55970792-164c-4a4a-88e5-7158d092d503;131656309980000000"
BackupExpirationTime : 3/22/2018 11:43:18 PM
BackupName : 55970792-164c-4a4a-88e5-7158d092d503;131656309980000000
BackupTime : 3/15/2018 11:43:18 PM
DatabaseName : database02
DatabaseDeletionTime : 3/18/2018 4:36:00 PM
Location : northeurope
ResourceId : /subscriptions/371edd6d-9630-4558-a7bd-ee139498e6a1/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server02/longTermRetentionDatabases/database02/longTermRetentionBackups/55970792-164c-4a4a-88e5-7158d092d503;131656309980000000
ServerName : server02
ServerCreateTime : 2/28/2018 12:12:19 AM
Deletes the backup with name 601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
Example 3: Delete all backups for a location
Get-AzSqlDatabaseLongTermRetentionBackup -Location northeurope | Remove-AzSqlDatabaseLongTermRetentionBackup
BackupExpirationTime : 3/22/2018 5:50:55 AM
BackupName : 601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
BackupTime : 3/15/2018 5:50:55 AM
DatabaseName : database01
DatabaseDeletionTime :
Location : northeurope
ResourceId : /subscriptions/371edd6d-9630-4558-a7bd-ee139498e6a1/resourceGroups/resourcegroup01/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server01/longTermRetentionDatabases/database01/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
ServerName : server01
ServerCreateTime : 2/29/2018 12:12:19 AM
BackupExpirationTime : 3/22/2018 11:43:18 PM
BackupName : 55970792-164c-4a4a-88e5-7158d092d503;131656309980000000
BackupTime : 3/15/2018 11:43:18 PM
DatabaseName : database02
DatabaseDeletionTime : 3/18/2018 4:36:00 PM
Location : northeurope
ResourceId : /subscriptions/371edd6d-9630-4558-a7bd-ee139498e6a1/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server02/longTermRetentionDatabases/database02/longTermRetentionBackups/55970792-164c-4a4a-88e5-7158d092d503;131656309980000000
ServerName : server02
ServerCreateTime : 2/28/2018 12:12:19 AM
This command deletes all long term retention backups for the northeurope location.
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
RemoveBackupDefault
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: False
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
RemoveBackupDefault
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: False
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
The Database Long Term Retention Backup object to remove.
RemoveBackupByInputObject
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
RemoveBackupDefault
Position: 0
Mandatory: True
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
RemoveBackupDefault
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 to remove.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
RemoveBackupByResourceId
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
RemoveBackupDefault
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: False
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 .
Outputs