{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json##", "contentVersion": "1.0.0.0", "parameters": { "companyname": { "type": "string", "defaultValue": "rg1", "metadata": { "description": "Default name for everything" } }, "location": { "type": "string", "defaultValue": "westeurope", "allowedValues": [ "westeurope", "northeurope" ], "metadata": { "description": "Location for the resourceGroup" } } }, "variables": { "rgName": "[toLower(concat('rg_', parameters('companyname')))]", "vmName": "[toLower(concat('vm-', parameters('companyname')))]", "vaultName": "[toLower(concat('vault-', parameters('companyname')))]", "backupFabric": "Azure", "backupPolicyName": "[toLower(concat('backupPolicy-', parameters('companyname')))]", "protectionContainer": "[concat('iaasvmcontainer;iaasvmcontainerv2;', variables('rgName'), ';', variables('vmName'))]", "protectedItem": "[concat('vm;iaasvmcontainerv2;', variables('rgName'), ';', variables('vmName'))]" }, "resources": [ { "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems", "apiVersion": "2020-02-02", "name": "[concat(variables('vaultName'), '/', variables('backupFabric'), '/', variables('protectionContainer'), '/', variables('protectedItem'))]", "dependsOn": [], "properties": { "protectedItemType": "Microsoft.Compute/virtualMachines", "policyId": "[resourceId('Microsoft.RecoveryServices/vaults/backupPolicies', variables('vaultName'), variables('backupPolicyName'))]", "sourceResourceId": "[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]" } } ] }