Estimated time: 15 minutes
Create a custom ARM Policy that requires a specific Tag be applied to all resources provisioned in a resource group.
Azure AD tenant
Completing previous tasks will meet pre-requisites.
Create a new policy named DemoPolicy that requires a costCenter tag.
{
"if": {
"not": {
"field": "tags",
"containsKey": "costCenter"
}
},
"then": {
"effect": "deny"
}
}
Now you will create a new resource group and assign the policy to the resource group. To complete this requirements:
Finally, you will test the policy. You will confirm that resources without the costCenter tag cannot be provisioned in the task-policy resource group, and those with the tag can. To complete the requirement:
Having trouble completing this task? View the demonstration video to see how to do it.