Answered by:
Cannot delete Recovery Services vault

-
Hi,
I have got an empty Recovery Services vault (not items there) which I cannot delete. It was used for Azure SQL Database backup. The SQL Server was also deleted.
I am getting this error:
Vault 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.
I tried to check also additional resources through https://resources.azure.com but there are no any additional items in my Recovery Services vault.
How can I delete it?
Thanks
Question
Answers
-
You may try - The PowerShell cmdlet to delete a recovery vault is “Remove-AzureRmRecoveryServicesVault -Vault <Vault-Object>”. To get the vault object using Get-AzureRmRecoveryServicesVault.
Users must exercise due caution while using the “Remove-AzureRmRecoveryServicesVault” cmdlet as this will delete the vault irrespective of the contents of the vault. So if there are replicating machines or backed up machines etc. in the vault, these will be lost. Additionally if there were on-premises assets that were registered to the vault, these would need to be manually cleaned up because clean up cannot be triggered from the vault once it has been deleted.
Regards,
Sadiqh
- Marked as answer by Anoop KV(MSFT)Microsoft employee Tuesday, December 20, 2016 1:33 PM
- Unmarked as answer by Anoop KV(MSFT)Microsoft employee Tuesday, December 20, 2016 1:33 PM
- Proposed as answer by Anoop KV(MSFT)Microsoft employee Tuesday, December 20, 2016 1:33 PM
- Marked as answer by Ruturaj DhekaneMicrosoft employee Monday, January 2, 2017 7:38 AM
All replies
-
Hi,
Thank you for contacting us!
Please follow the steps in the article below to delete the recovery services vault.
https://docs.microsoft.com/en-us/azure/backup/backup-azure-delete-vault
Hope that helps!
Best Regards
Sadiqh Ahmed
________________________________________________________________________________________________If this post was helpful to you, please up vote it and/or mark it as an answer so others can more easily find it in the future
-
-
-
-
You may try - The PowerShell cmdlet to delete a recovery vault is “Remove-AzureRmRecoveryServicesVault -Vault <Vault-Object>”. To get the vault object using Get-AzureRmRecoveryServicesVault.
Users must exercise due caution while using the “Remove-AzureRmRecoveryServicesVault” cmdlet as this will delete the vault irrespective of the contents of the vault. So if there are replicating machines or backed up machines etc. in the vault, these will be lost. Additionally if there were on-premises assets that were registered to the vault, these would need to be manually cleaned up because clean up cannot be triggered from the vault once it has been deleted.
Regards,
Sadiqh
- Marked as answer by Anoop KV(MSFT)Microsoft employee Tuesday, December 20, 2016 1:33 PM
- Unmarked as answer by Anoop KV(MSFT)Microsoft employee Tuesday, December 20, 2016 1:33 PM
- Proposed as answer by Anoop KV(MSFT)Microsoft employee Tuesday, December 20, 2016 1:33 PM
- Marked as answer by Ruturaj DhekaneMicrosoft employee Monday, January 2, 2017 7:38 AM
-
-
-
@Robert J Head, reach out to Azure Support by using the URL at http://aka.ms/getazuresupport.
-
-
I have the same problem with a recovery-service-vault that can't be deleted. If I use the Powershell Command to delete the vault I get the following error:
Remove-AzureRmRecoveryServicesVault : Operation Failed.
ErrorCode: ServiceResourceNotEmpty
Message: Vault cannot be deleted as there are existing resources within the vault.But as Sadiqh mentioned, the vault should also be deleted if it is not empty. Any advice and suggestions will be greatly appreciated.
-
This problem seems to come from setting up long term retention on an SQL server (one of that causes anyway).
In order to remove the recovery vault(s), assuming they are already completely empty I was able to use the following Powershell script:
Login-AzureRmAccount $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
Hope this helps. Again make sure the vault is completely empty and you have retrieved all data you wish to keep.
- Proposed as answer by Felipe de Assis Tuesday, July 4, 2017 12:34 AM
-
-