Is it possible to get the name of a backup policy I'll want to apply, from a Virtual Machine tag value ? For example : backup=myBackupPolicyDaily1AM or backup=myBackupPolicyWeekly
In Azure, I have these resources :
I've applied the Azure Policy with these parameters :
Things are working fine so far. After a Remediation, vmtest01 is backed up.
Now I want to apply the Backup Policy name I'll have from the backup tag value. For example :
I've search on the interwebs and didn't see any example for that use case. Is it possible ?
Note: All the resources are in the same location.
Have you tried changing the BackupPolicy variable to [parameters('inclusionTagValue')]
(~ line 473)? You will first need to duplicate the built-in policy and make it custom. I am testing this now but it will take a little time for Azure policy to evaluate and remediate.
"variables": {
"backupFabric": "Azure",
"backupPolicy": "[parameters('inclusionTagValue')]",
"v2VmType": "Microsoft.Compute/virtualMachines",
"v2VmContainer": "iaasvmcontainer;iaasvmcontainerv2;",
"v2Vm": "vm;iaasvmcontainerv2;",
"vaultName": "[take(concat('RSVault-', parameters('location'), '-', guid(resourceGroup().id)),50)]"
}