Remove recovery service vault completely from azure vm using PowerShell

Shekar Yenagandula 116 Reputation points

Tried all the solutions. Tried using Disable-AzRecoveryServiceBackupProtection but kys just deleting the back up data. I want to remove(not delete) rsv from VM so that I can assign new rsv

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,143 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,285 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Tasadduq Burney 8,376 Reputation points MVP

    To remove a Recovery Service vault completely from an Azure VM using PowerShell, you can use the following steps:

    Stop-AzRecoveryServicesBackupJob -Name "MyVM"
    Remove-AzRecoveryServicesBackupItem -Name "MyVM"
    Remove-AzRecoveryServicesVault -Name "MyRSVault"

  2. KarishmaTiwari-MSFT 18,637 Reputation points Microsoft Employee

    Hi @Shekar Yenagandula Thanks for posting your query on Microsoft Q&A.

    I would recommend following the step by step guide using Azure PowerShell (if not checked already) , as per your requirement, , to
    Delete an Azure Backup Recovery Services vault
    Delete a Site Recovery Services vault
    If you are looking for deleting Azure Backup Recovery Services vault, please check the following pre-requisites :
    User's image

    If you meet all the pre-requisites, then the next steps involve using Remove-AzRecoveryServicesVault command after Disable-AzRecoveryServicesBackupProtection command.

    If you have already tried these steps in the document and still stuck, please let me know in the comments and I can further investigate.

  3. Shekar Yenagandula 116 Reputation points


    Get the VMVault and set the default context.

    Get RSV backup item and store it varible called A.

    Loop through container A and for each Item undo backupitem deletion

    Also get the backup item specific to VM and loop through each Item and disabling works.

    I managed to resolve. We can close this thread.