You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I read somewhere that I can achieve the deletion if I switch from the cmdlets to the REST API, but how can I rely on the Get-AzRecoveryServicesBackupItem command to filter the correct workload type?
I ran the command with the -Debug switch, and the API URi behind the command doesn't include the "-WorkloadType FileFolder" part of the command as part of the query filter.:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using PS to delete a recovery services vault. I am disabling protection after getting all containers. Here is the snippet.:
Try {
$VMContainers = Get-AzRecoveryServicesBackupContainer -VaultId $vault.id -ContainerType AzureVM
$StorageContainers = Get-AzRecoveryServicesBackupContainer -VaultId $vault.id -ContainerType AzureStorage
$VMAppContainers = Get-AzRecoveryServicesBackupContainer -VaultId $vault.id -ContainerType AzureVMAppContainer
$MABContainers = Get-AzRecoveryServicesBackupContainer -VaultId $vault.id -ContainerType Windows -BackupManagementType MAB
}
Catch {
$getBckpErr = $_
}
My issue is when finding Windows containers, I try to filter for workload type (as follow):
Set-AzRecoveryServicesVaultContext -Vault $vault
Foreach ($container in $MABContainers) {
$VMBackupItem = Get-AzRecoveryServicesBackupItem -Container $container -WorkloadType AzureVM -EA SilentlyContinue
$FilesBackupItem = Get-AzRecoveryServicesBackupItem -Container $container -WorkloadType AzureFiles -EA SilentlyContinue
$MSSQLBackupItem = Get-AzRecoveryServicesBackupItem -Container $container -WorkloadType MSSQL -EA SilentlyContinue
$FileFolderBackupItem = Get-AzRecoveryServicesBackupItem -Container $container -WorkloadType FileFolder -EA SilentlyContinue
$SAPHanaDatabaseBackupItem = Get-AzRecoveryServicesBackupItem -Container $container -WorkloadType SAPHanaDatabase -EA SilentlyContinue}
Checking these variables yields the first issue: they all contain the SAME backup item of 'FileFolder' workload type.
FriendlyName ContainerType ContainerUniqueName WorkloadType LastBackupStatus
C:\ Windows {containername}.europe.corp.microsoft.com FileFolder Completed
Then, when trying to remove the container using:
Disable-AzRecoveryServicesBackupProtection -Item $vmbitem -VaultId $vault.Id -RemoveRecoveryPoints -Force
Disable-AzRecoveryServicesBackupProtection -Item $vmbitem -RemoveRecoveryPoints -Force
I get this error:
Disable-AzRecoveryServicesBackupProtection: Unsupported WorkloadType: FileFolder
I read somewhere that I can achieve the deletion if I switch from the cmdlets to the REST API, but how can I rely on the Get-AzRecoveryServicesBackupItem command to filter the correct workload type?
I ran the command with the -Debug switch, and the API URi behind the command doesn't include the "-WorkloadType FileFolder" part of the command as part of the query filter.:
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://management.azure.com/subscriptions/959e73d4-6e8c-4aea-a858-f842a23fed90/resourceGroups/InternalRG/providers/Microsoft.RecoveryServices/vaults/InternalRecoveryVault/backupProtectedItems?$filter=backupManagementType eq 'MAB'&api-version=2023-04-01
Can someone help?
Beta Was this translation helpful? Give feedback.
All reactions