Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Why is my Azure recovery services vault not getting deleted?

While working on Azure Portal Get Azure virtual machine backup reports using Powershell I was trying to decommision few Azure Recovery Service Vault (Backup) resource by deleteing it, I went to Azure portal selected Recovery Service Vault from Resource Group and pressed delete button, but I was receiving below errors.

Executed delete command on 1 selected items
Succeeded: 0, Failed: 1, Canceled: 0.
Error details
vault828: Recovery Services vault cannot be deleted as there are backup items in soft deleted state in the vault. The soft deleted items are permanently deleted after 14 days of delete operation. Please try vault deletion after the backup items are permanently deleted and there is no item in soft deleted state left in the vault.For more information, refer https://aka.ms/SoftDeleteCloudWorkloads. The registered items are : vcloud-lab-vm01
Please ensure all containers have been unregistered from the vault and all private endpoints associated with the vault have been deleted, and retry operation. For more details, see https://aka.ms/AB-AA4ecq5 (Code: ServiceResourceNotEmptyWithBackendMessage)

Executed delete command on 15 selected items
Succeeded: 14, Failed: 1, Canceled: 0.
Error details
vault828: Vault cannot be deleted as there are existing resources within the vault. : vcloud-lab-vm01
Please ensure all containers have been unregistered from the vault and all private endpoints associated with the vault have been deleted, and retry operation. For more details, see https://aka.ms/AB-AA4ecq5 (Code: ServiceResourceNotEmptyWithBackendMessage)

Microsoft Azure Portal Backup recovery services vault delete operation backup item soft delete container unregistered endpoint associated.png

I clicked on Recovery Services Vault and checked Backup items from right side navigation pane. I found there is a Backup Item exist with backup management type of Azure Virtual Machine, Before attempting deleting vault All backup Item count should be 0 or there shouldn't be backup in soft delete which I will discuss later in this article.

Microsoft Azure portal recovery services vault backup items site recovery private endpoint connections azure virtual machine backup management type sql sap storage replication.png

I clicked on the backup item, selected Virtual Machine name, on the 3 vertical dots, clicked delete backup data.

Backup Items Azure virtual machines backup Pre-check Last backup status warning backup disabled Latest resotre point Restore VM File recovery delete backup data resume backup.png

Next I received option either to retain or delete backup data. Selected Delete backup data, this option will stop all scheduled backup job and delete backup data. Validation successful after clicking Delete button.

Microsoft Azure Portal Delete Backup Data Backup Items Azure Virtual Machines stop all scheduled backup jobs reason retain backup validation successful recovery services vault.png

Now Tried to delete Recovery Services Vault again, but I was receiving same error again. Root cause - This happens due to backup data will be deleted permanently after 14 days, it is protected under soft delete feature. Now I dont want to wait for that much time and delete it instantly.

Microsoft Azure Portal Backup recovery services vault delete operation backup item soft delete container unregistered endpoint associated.png

To resolve the issue I went to Virtual Machine Backup Item clicked on 3 vertical dots and Undelete it from context menu.

Microsoft azure portal recovery services vault site recovery Backup items Azure virtual machine resource group last backup status pre-check latest restore point undelete resume delete stop restore backup.png

All restore points for this backup item will be undeleted and the item will come to 'Stop protection will retain data' state. You can 'Resume Backup' to continue the scheduled backupoperations as per the selected policy. Note: Garbage Collection will start with resume backup operation and all the expired restore points will be cleaned.

This shows the days left until permanant deletion, Click Undelete button.

Microsoft Azure portal Backup items recover vault services undelete virtual machine vm scheduled backup policy garbage collection expired restore point cleaned.png

Go to Recover Services Vault Properties from left pane. Click Security Settings Update. On the Disable Soft Delete feature. This Soft delete feature is only available for eligible backup management types. Soft delete protects backup data from accidental deletes. Once you disable it, All Future deletes will be instant and will not have soft delete protection this action will not impact items already in soft deleted state.

Microsoft Azure Recovery Services vault properties backup security update soft delete for elegible backup management type enable disable features backup items virtual machines.png

Now try deleting backup data again, go to Backup Items Azure Virtual Machine, Click Delete backup data.

Microsoft Azure Portal Backup Items Azure virtual machines delete backup data file recovery resume backup restore vm resource group backup Pre-check Last backup status Latest restore point fetch.png

Select the name of Backup Item and click Delete button. Validation is successful.

Microsoft Azure Recovery serivces vault stop all scheduled backup jobs delete backup data soft delete cloud workloads reason others comments validation successful delete.png

Now under Backup Items there are 0 Bakcup item count.

Microsoft Azure Backup Items recovery services vault backup site recovery backup management type azure storage azure files azure vartual machines dpm backup agent server sap hana sql in vm.png

In the last click Delete button on Recovery Services Vault or from select vault on Resource group.

Microsoft Recovery services vault backup site recovery backup items replicated items backup polices backup infrastructure backup center auzre managed disk encyption delete enable site recovery backup reports.png

This is a confirmation dialog box, Make sure you want to delete Recovery Services Vault name, Click Yes button.

Microsoft Azure Delete Recovery services vault backup items azure virtual machines backup undelete soft delete failed wait 14 days.png

This time Recovery Services vault successfully deleted without any error.

Microsoft Azure services resources group automation accounts recovery services vault deleted successfully without 14 15 days wait Azure active directory subscriptions sponsered by microsoft Azure .png

Useful Information
Create an Azure App registrations in Azure Active Directory using PowerShell & AzureCLI
Get started and configure with certificate-based authentication in Azure
Create a Virtual machine on Microsoft Azure
PowerShell List All Azure Resverations
Powershell get the list of Azure Reservations Virtual Machines instances
Get the list Azure Reservation Catalog with PowerShell and AzureCLI
Azure automation account DSC for On-Premise Virtual Machine on boarding
Azure Powershell : Operation returned an invalid status code 'BadRequest'
Get Azure virtual machine backup reports using Powershell

Go Back

Comment

Blog Search

Page Views

11380463

Follow me on Blogarama