如何删除Azure Recovery Services保管库?

时间:2017-06-07 06:14:26

标签: azure backup azure-storage

当我尝试从Azure门户删除Azure恢复服务保险库时,我收到了如下图所示的错误。甚至我从保险库中删除了所有备份项和复制项。

enter image description here

要删除Azure Recovery Services保管库,我已按照以下链接

Delete an Azure Backup vault

那么,如何使用portal或power shell cmdlet删除Azure恢复服务库?

2 个答案:

答案 0 :(得分:4)

我曾经遇到同样的问题,保险库中有SQL备份。您需要找到SQL备份并将其删除。

您可以查看此answer来解决此问题。

$vault = Get-AzureRmRecoveryServicesVault -Name "VaultName"

Set-AzureRmRecoveryServicesVaultContext -Vault $vault

#VIEW THE BACKUP ITEMS
$container = Get-AzureRmRecoveryServicesBackupContainer -ContainerType AzureSQL -FriendlyName $vault.Name

$item = Get-AzureRmRecoveryServicesBackupItem -Container $container -WorkloadType AzureSQLDatabase

$availableBackups = Get-AzureRmRecoveryServicesBackupRecoveryPoint -Item $item

$availableBackups      
#REMOVE THE BACKUP ITEMS AND VAULT
$containers = Get-AzureRmRecoveryServicesBackupContainer -ContainerType AzureSQL -FriendlyName $vault.Name

ForEach ($container in $containers)
{
    $items = Get-AzureRmRecoveryServicesBackupItem -container $container -WorkloadType AzureSQLDatabase

    ForEach ($item in $items)
    {
        Disable-AzureRmRecoveryServicesBackupProtection -item $item -RemoveRecoveryPoints -ea SilentlyContinue
    }

    Unregister-AzureRmRecoveryServicesBackupContainer -Container $container
}

Remove-AzureRmRecoveryServicesVault -Vault $vault

答案 1 :(得分:1)

如果启用了软删除,则通常必须等待14天左右。关闭存储库中的软删除,然后取消删除并重新删除VM,然后可以删除该库