Asked by:
Get-AzureRmRecoveryServicesBackupItem not showing Backup Items

Question
-
Hi, I'm running the following script to return Backup Items in a Recovery Services Vault container, the Backup Items exist in the container however, the script does not return any item.
*******************************************
#Get image from Vault
$VaultName = "MW-RS-QA-DPM-01"
$Vault = Get-AzureRmRecoveryServicesVault -Name $VaultName
Set-AzureRmRecoveryServicesVaultContext -Vault $Vault
$namedContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" –Status "Registered" -FriendlyName "MW-VM-QA-QST-01"
$backupitem = Get-AzureRmRecoveryServicesBackupItem –Container $namedContainer –WorkloadType AzureVM*******************************************
When I run the Get-AzureRmRecoveryServicesBackupItem with -Debug I can actually see that the items are there. I think that there is a mismatch between the -WorkloadType parameter value (AzureVM) and the actual workload type in the Backup Item (VM) as it is shown in the debug output. In that case it must be a bug in the cmdlet... can you please confirm this?
AzureRM.RecoveryServices.Backup Module version: 3.1.0
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Pragma : no-cache
x-ms-request-id : fe61c563-36d1-4eef-b602-2e4b8d7de01b
x-ms-client-request-id : 97534986-7c46-4860-8b15-a8ebf6758906,97534986-7c46-4860-8b15-a8ebf6758906
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 14997
x-ms-correlation-request-id : fe61c563-36d1-4eef-b602-2e4b8d7de01b
x-ms-routing-request-id : EASTUS2:20170703T124322Z:fe61c563-36d1-4eef-b602-2e4b8d7de01b
Cache-Control : no-cache
Date : Mon, 03 Jul 2017 12:43:22 GMT
Server : Microsoft-IIS/8.0
X-Powered-By : ASP.NET
Body:
{
"value": [
{
"id": "/Subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-RSV/providers/Microsoft.RecoveryServices/vaults/MW-RS-QA-DPM-01/backupFabrics/Azure/protectionContaine
rs/IaasVMContainer;iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-DCK-01/protectedItems/VM;iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-DCK-01",
"name": "VM;iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-DCK-01",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems",
"properties": {
"friendlyName": "MW-VM-QA-DCK-01",
"virtualMachineId": "/subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-INF/providers/Microsoft.Compute/virtualMachines/MW-VM-QA-DCK-01",
"protectionStatus": "Healthy",
"protectionState": "Protected",
"healthStatus": "Passed",
"healthDetails": [
{
"code": 400239,
"title": "IaasVmHealthGreenDefault",
"message": "Backup pre-check status of this virtual machine is OK.",
"recommendations": []
}
],
"lastBackupStatus": "Completed",
"lastBackupTime": "2017-07-02T22:00:42.6466978Z",
"protectedItemDataId": "246291870023985",
"protectedItemType": "Microsoft.Compute/virtualMachines",
"backupManagementType": "AzureIaasVM",
"workloadType": "VM",
"containerName": "iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-DCK-01",
"sourceResourceId": "/subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-INF/providers/Microsoft.Compute/virtualMachines/MW-VM-QA-DCK-01",
"policyId": "/Subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-RSV/providers/Microsoft.RecoveryServices/vaults/MW-RS-QA-DPM-01/backupPolicies/DefaultPolicy",
"policyName": "DefaultPolicy",
"lastRecoveryPoint": "2017-07-02T22:01:12.8452968Z"
}
},
{
"id": "/Subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-RSV/providers/Microsoft.RecoveryServices/vaults/MW-RS-QA-DPM-01/backupFabrics/Azure/protectionContaine
rs/IaasVMContainer;iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-QST-01/protectedItems/VM;iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-QST-01",
"name": "VM;iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-QST-01",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems",
"properties": {
"friendlyName": "MW-VM-QA-QST-01",
"virtualMachineId": "/subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-INF/providers/Microsoft.Compute/virtualMachines/MW-VM-QA-QST-01",
"protectionStatus": "Healthy",
"protectionState": "Protected",
"healthStatus": "Passed",
"healthDetails": [
{
"code": 400239,
"title": "IaasVmHealthGreenDefault",
"message": "Backup pre-check status of this virtual machine is OK.",
"recommendations": []
}
],
"lastBackupStatus": "Completed",
"lastBackupTime": "2017-07-02T22:16:05.5895666Z",
"protectedItemDataId": "246291516026578",
"protectedItemType": "Microsoft.Compute/virtualMachines",
"backupManagementType": "AzureIaasVM",
"workloadType": "VM",
"containerName": "iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-QST-01",
"sourceResourceId": "/subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-INF/providers/Microsoft.Compute/virtualMachines/MW-VM-QA-QST-01",
"policyId": "/Subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-RSV/providers/Microsoft.RecoveryServices/vaults/MW-RS-QA-DPM-01/backupPolicies/DefaultPolicy",
"policyName": "DefaultPolicy",
"lastRecoveryPoint": "2017-07-02T22:16:38.7702832Z"
}
},
{
"id": "/Subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-RSV/providers/Microsoft.RecoveryServices/vaults/MW-RS-QA-DPM-01/backupFabrics/Azure/protectionContaine
rs/IaasVMContainer;iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-TRF-01/protectedItems/VM;iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-TRF-01",
"name": "VM;iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-TRF-01",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems",
"properties": {
"friendlyName": "MW-VM-QA-TRF-01",
"virtualMachineId": "/subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-INF/providers/Microsoft.Compute/virtualMachines/MW-VM-QA-TRF-01",
"protectionStatus": "Healthy",
"protectionState": "Protected",
"healthStatus": "Passed",
"healthDetails": [
{
"code": 400239,
"title": "IaasVmHealthGreenDefault",
"message": "Backup pre-check status of this virtual machine is OK.",
"recommendations": []
}
],
"lastBackupStatus": "Completed",
"lastBackupTime": "2017-07-02T22:10:38.9097873Z",
"protectedItemDataId": "246292449631248",
"protectedItemType": "Microsoft.Compute/virtualMachines",
"backupManagementType": "AzureIaasVM",
"workloadType": "VM",
"containerName": "iaasvmcontainerv2;MW-RG-QA-INF;MW-VM-QA-TRF-01",
"sourceResourceId": "/subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-INF/providers/Microsoft.Compute/virtualMachines/MW-VM-QA-TRF-01",
"policyId": "/Subscriptions/446f4b31-ff36-493d-a414-1178f77b3178/resourceGroups/MW-RG-QA-RSV/providers/Microsoft.RecoveryServices/vaults/MW-RS-QA-DPM-01/backupPolicies/DefaultPolicy",
"policyName": "DefaultPolicy",
"lastRecoveryPoint": "2017-07-02T22:11:53.3660319Z"
}
}
]
}
DEBUG: 9:44:16 AM - GetAzureRmRecoveryServicesBackupItem end processing.
DEBUG: 9:44:16 AM - GetAzureRmRecoveryServicesBackupItem end processing.
- Moved by Bill_Stewart Monday, September 11, 2017 2:05 PM This is not a bug report verification/confirmation forum
Monday, July 3, 2017 1:19 PM