Remove-AzureRmSqlDatabaseLongTermRetentionBackup
Deletes a long term retention backup.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
Remove-AzureRmSqlDatabaseLongTermRetentionBackup
[-Location] <String>
[-ServerName] <String>
[-DatabaseName] <String>
[-BackupName] <String>
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzureRmSqlDatabaseLongTermRetentionBackup
[-InputObject] <AzureSqlDatabaseLongTermRetentionBackupModel>
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzureRmSqlDatabaseLongTermRetentionBackup
[-ResourceId] <String>
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-AzureRmSqlDatabaseLongTermRetentionBackup cmdlet deletes the backup specified.
Examples
Example 1: Delete a single backup
PS C:\> Remove-AzureRmSqlDatabaseLongTermRetentionBackup -Location northeurope -ServerName server01 -DatabaseName database01 -BackupName "601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000"
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/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 all backups for a location
PS C:\> Get-AzureRmSqlDatabaseLongTermRetentionBackup -Location northeurope | Remove-AzureRmSqlDatabaseLongTermRetentionBackup
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
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/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
This command deletes all long term retention backups for the northeurope location.
Parameters
-BackupName
The name of the backup.
Type: | String |
Position: | 3 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DatabaseName
The name of the Azure SQL Database the backup is from.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Skip confirmation message for performing the action
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
The Database Long Term Retention Backup object to remove.
Type: | AzureSqlDatabaseLongTermRetentionBackupModel |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Location
The location of the backups' source server.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResourceId
The Resource ID of the Database Long Term Retention Backup to remove.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServerName
The name of the Azure SQL Server the backup is under.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Outputs
AzureSqlDatabaseLongTermRetentionBackupModel