I have a PowerShell script that is used for deleting resource groups. Currently, it is not deleting due to RecoveryServicesVault
and it having backup items (VMs).
I tried to delete the backup items using the command Disable-AzureRmRecoveryServicesBackupProtection
, but it is doing a soft-delete and I need to wait for next 14 days to get it deleted permanently.
But as this PowerShell script is executing under a scheduled job, again the next day it will execute the above command and it will again wait another 14 days for the permanent deletion.
Is there any way to check whether the backup items are already soft-deleted and hold to execute it again?
I know the Az module has a command Get-AzRecoveryServicesBackupItem
, which will give us the DeleteState
. But this feature isn't in Get-AzureRmRecoveryServicesBackupItem
.