{
   "properties": {
      "displayName": "Append tag and its default value",
      "policyType": "BuiltIn",
      "mode": "Indexed",
      "description": "Appends the specified tag and value when any resource which is missing this tag is created or updated. Does not modify the tags of resources created before this policy was applied until those resources are changed. Does not apply to resource groups. New 'modify' effect policies are available that support remediation of tags on existing resources (see https://aka.ms/modifydoc).",
      "metadata": {
         "category": "Tags"
      },
      "parameters": {
         "tagName": {
            "type": "String",
            "metadata": {
               "description": "Name of the tag, such as costCenter"
            }
         },
         "tagValue": {
            "type": "String",
            "metadata": {
               "description": "Value of the tag, such as headquarter"
            }
         }
      },
      "policyRule": {
         "if": {
            "field": "[concat('tags[', parameters('tagName'), ']')]",
            "exists": "false"
         },
         "then": {
            "effect": "append",
            "details": [
               {
                  "field": "[concat('tags[', parameters('tagName'), ']')]",
                  "value": "[parameters('tagValue')]"
               }
            ]
         }
      }
   },
   "id": "/providers/Microsoft.Authorization/policyDefinitions/2a0e14a6-b0a6-4fab-991a-187a4f81c498",
   "type": "Microsoft.Authorization/policyDefinitions",
   "name": "2a0e14a6-b0a6-4fab-991a-187a4f81c498"
}