Hi
Using ARM template and in ResourceGroupA I have provisioned misc resources such as vnet etc and a recovery vault and its backup policies.
Using another ARM template and in ResourceGroupB im creating application resources such as VM, DB and a storage account and its file share. Here im getting a problem to add a Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems type using the existing vault created earlier ResourceGroupA
Extract from my ARM teamplate that im trying to deploy in ResourceGroupB:
"variables": {
"namespace": "[tolower(replace(parameters('jiraBaseUrl'),'.', ''))]",
"vault": {
"name": "rsv-RiadaCloud",
"policy": "DailyFileShare",
"backupFabric": "Azure",
"protectionContainers": "[array(concat('storagecontainer;storage;', parameters('vnetResourceGroup'), ';', variables('jira').storage.name))]",
"protectedItems": "[array(concat('azurefileshare;', variables('jira').storage.sharedHomeName))]"
},
...
{
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems",
"apiVersion": "2016-06-01",
"name": "[concat(variables('vault').name, '/', variables('vault').backupFabric, '/', variables('vault').protectionContainers[copyIndex()], '/', variables('vault').protectedItems[copyIndex()])]",
"properties": {
"backupManagementType": "AzureStorage",
"workloadType": "AzureFileShare",
//"friendlyName": "afs",
"protectedItemType": "AzureFileShareProtectedItem",
"policyId": "[resourceId(parameters('vnetResourceGroup'), 'Microsoft.RecoveryServices/vaults/backupPolicies/', variables('vault').name, variables('vault').policy)]",
"sourceResourceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('jira').storage.name)]"
},
"copy": {
"name": "protectedItemsCopy",
"count": "[length(variables('vault').protectedItems)]"
}
}
The error message is:
Deployment failed. Correlation ID: 939a19e8-c2fd-4bc0-bb4a-058cf2929bb3. {
"error": {
"code": "ResourceNotFound",
"message": "The Resource 'Microsoft.RecoveryServices/vaults/rsv-RiadaCloud' under resource group 'ResourceGroupB' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"
}
}