Azure Policy require multiple tags with values
I have a policy that requires specific tag with specific values (json below), but I want to require more tags within the same policy also with specific value and not sure how to do it…
Is there a way to add more tags with specific values to the same policy?
For example, I want to require two tags:
environment with prod/non-prod and department with Infra/Finance
Is it possible?
Thank you!
I have a policy that requires specific tag with specific values (json below), but I want to require more tags within the same policy also with specific value and not sure how to do it… Is there a way to add more tags with specific values to the same policy?For example, I want to require two tags:environment with prod/non-prod and department with Infra/Finance Is it possible?Thank you! { “properties”: { “displayName”: “Require tag environment and its values on resources “, “policyType”: “Custom”, “mode”: “Indexed”, “description”: “Enforces a required tag environment and its value. Does not apply to resource groups.”, “metadata”: { “category”: “Tags”, “createdBy”: “” “createdOn”: “” “updatedBy”: “” “updatedOn”: “” }, “version”: “1.0.0”, “parameters”: { “tagName”: { “type”: “String”, “metadata”: { “displayName”: “Tag Name1”, “description”: “Name of the tag, such as ‘environment'” }, “allowedValues”: [ “environment” ] }, “tagValue”: { “type”: “Array”, “metadata”: { “displayName”: “Tag Value1”, “description”: “Value of the tag, such as ‘production'” }, “allowedValues”: [ “prod”, “non-prod” ] } }, “policyRule”: { “if”: { “not”: { “field”: “[concat(‘tags[‘, parameters(‘tagName’), ‘]’)]”, “in”: “[parameters(‘tagValue’)]” } }, “then”: { “effect”: “deny” } }, “versions”: [ “1.0.0” ] }, }} Read More