Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save larryclaman/5503dfb1cc53f85e0915b7b829bcb000 to your computer and use it in GitHub Desktop.
Save larryclaman/5503dfb1cc53f85e0915b7b829bcb000 to your computer and use it in GitHub Desktop.
Azure Policy to enforce Tag & Pattern
{
"properties": {
"displayName": "Require a tag, value and pattern",
"policyType": "Custom",
"mode": "Indexed",
"description": "Enforces a required tag and its value. Does not apply to resource groups.",
"metadata": {
"category": "Tags",
"createdBy": "10742b83-5bcb-45ba-9a2b-8a953928fc04",
"createdOn": "2020-04-01T16:11:01.7403115Z",
"updatedBy": "10742b83-5bcb-45ba-9a2b-8a953928fc04",
"updatedOn": "2020-04-01T16:18:18.6767553Z"
},
"parameters": {
"tagName": {
"type": "String",
"metadata": {
"displayName": "Tag Name",
"description": "Name of the tag, such as 'deptcode'"
}
},
"tagValue": {
"type": "String",
"metadata": {
"displayName": "Tag Value",
"description": "pattern of the tag, such as 'ABC???'"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment