I need help in deleting a Recovery Services vault in Azure.

John Hancock 0 Reputation points
2024-10-18T02:11:09.3233333+00:00

Hello,

I inherited a VM which had Microsoft Azure Recovery Services (MARS) agent installed on it. It was also registered as an Azure Backup Agent with Recovery Services Vault. On a second VM, MARS was also installed and registered with Azure Backup Agent. The second VM tried to recover from the first VM, but the recovery was truncated.

Now, both VMs have been deleted and I don't want to recover either of them. I do however want to also delete the Recovery Services Vault. When I went into the Backup Items, there is one Azure Backup Agent, but I cannot delete it.

Capture1

Next, I went into the Backup Infrastructure and saw the first VM.

Capture4

However, when I go to delete it, I get an error message.

Capture3

Please tell me how I can delete the Recovery Services Vault. Thank you.

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,290 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vinodh247 24,086 Reputation points MVP
    2024-10-19T13:14:09.1633333+00:00

    Hi John Hancock,

    Thanks for reaching out to Microsoft Q&A.

    To delete the Recovery Services Vault in Azure, you need to follow a few steps to ensure that all dependencies (like backup items and backup policies) are removed, as they are blocking the deletion. Since you are unable to delete the recovery services vault directly due to the azure backup agent registration, here is the guide you can try to resolve this:

    Steps to delete the Recovery Services Vault:

    1. Stop Backup Protection for the Backup Item:
      • Go to the Recovery Services Vault in the Azure portal.
      • Under Backup Items, find the Azure Backup Agent item (WEBVM01 as seen in your screenshots).
      • Click on the Backup Item (WEBVM01) and select Stop backup.
      • When you stop backup, ensure you delete the backup data as well. This will remove the backup from Azure.
    2. Unregister the Server:
      • After the backup protection is stopped and the data is deleted, go to the Backup Infrastructure section in the Recovery Services Vault.
      • Select Protected Servers under Azure Backup Agent.
      • Find the server (WEBVM01), and choose Unregister. This will remove the association of the VM with the vault.
    3. Check for Backup Policies:
      • Ensure that any associated backup policies for the vault are deleted. Go to Backup Policies in the Recovery Services Vault and remove any policies associated with the VMs or backup agents.
      Try Deleting the Recovery Services Vault Again:
      • Once all backup items and servers are unregistered, go back to the Recovery Services Vault and try deleting it again. You should no longer encounter the "backup items associated with the server" error.

    If you are still unable to delete the vault after following these steps, you may need to verify if there are any other lingering dependencies like softdeleted items or use PowerShell/Azure CLI commands to force the deletion.

    Let me know if you need futher details.

    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.