**Az104 lab 10 Have created 2 backup items in Recovery Services Vault but unable to remove/delete it
Azure VM & Azure Backup Agent**
On trying to remove or delete these items; since soft-delete is enabled (Say for 14 days). Facing error on Manual as well as PowerShell Delete procedures.
PowerShell seems to be not updated with Current menu options in Azure Portal. I used the below; get the status as success but VM and Agent still appear in my subscription.
Below is the PS I used
Undo-AzRecoveryServicesBackupItemDeletion -Item $myBKpItem -VaultId $myVaultID -Force
Disable-AzRecoveryServicesBackupProtection -Item $myBkpItem -RemoveRecoveryPoints -VaultId $myVaultID -Force
And ms-learn docs the below PowerShell seems to not work
Set-AzRecoveryServicesVaultProperty -VaultId $myVaultID -SoftDeleteFeatureState Disable
It gives a result of Bad Request saying -SoftDeleteFeatureState does not exists for Set-AzRecoveryServicesVaultProperty
What may be possible ways to delete soft-delete enabled backup VM on the recovery services vault.
So I replicated your problem as best as I could, this is what I did:
Create RSV, add VM into RSV with soft delete enabled, then deleted and had the VM in soft delete state. I went into the RSV and manually clicked undelete, which put the VM back into the RSV and then ran the below turn off soft delete:
Set-AzRecoveryServicesVaultProperty -VaultId "myvault" -SoftDeleteFeatureState Disable
I then ran the below to remove the VM from the vault and remove any associated backup data:
And then I ran the below to force delete the RSV:
az backup vault delete --name --resource-group --force
You should just need to update RG and RSV names and IDs and hopefully it should work for you.