0
votes

When I tried to delete the vault it gives me Vault deletion error: Vault 'sqldbvault' cannot be deleted as there are existing resources within the vault. Please delete any replicated items, registered servers, Hyper-V sites (Used for Site Recovery), policy associations for System Center VMM clouds (Used for Site Recovery) and then delete the vault.

There are no entries in replicated items, registered servers, Hyper-V sites (Used for Site Recovery), policy associations for System Center VMM clouds. However I still get the error. Please help.

1

1 Answers

0
votes

Maybe it's due Long Term Retention was applied over this vault, and SQL Backups aren't seen over portal yet (remenber you accepted preview terms ;-) ) Check this powershell script (thanks to theLateWizard on another forum portal)

Login-AzureRmAccount

Set-AzureRmContext -SubscriptionId <yoursubscriptionid>

$vault = Get-AzureRmRecoveryServicesVault -Name <vaultname>
Set-AzureRmRecoveryServicesVaultContext -Vault $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