last sync: 2020-Jul-02 13:28:37 UTC

Azure Policy

Append a tag and its value from the resource group

Policy DisplayName Append a tag and its value from the resource group
Policy Id 9ea02ca2-71db-412d-8b00-7c7ca9fcd32d
Policy Category Tags
Policy Description Appends the specified tag with its value from the resource group 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. New 'modify' effect policies are available that support remediation of tags on existing resources (see https://aka.ms/modifydoc).
Policy Mode Indexed
Policy Type BuiltIn
Policy in Preview FALSE
Policy Deprecated FALSE
Policy Effect Fixed: append
Roles used none
Policy Changes
Date/Time (UTC ymd) (i) Change Change detail
2020-03-10 16:29:49 change: DisplayName previous DisplayName: Append tag and its value from the resource group
Used in Policy Initiative(s) none
Policy Rule
{
  "properties": {
    "displayName": "Append a tag and its value from the resource group",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Appends the specified tag with its value from the resource group 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. New 'modify' effect policies are available that support remediation of tags on existing resources (see https://aka.ms/modifydoc).",
    "metadata": {
      "version": "1.0.0",
      "category": "Tags"
    },
    "parameters": {
      "tagName": {
        "type": "String",
        "metadata": {
          "displayName": "Tag Name",
          "description": "Name of the tag, such as 'environment'"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
          "field": "[concat('tags[', parameters('tagName'), ']')]",
            "exists": "false"
          },
          {
          "value": "[resourceGroup().tags[parameters('tagName')]]",
            "notEquals": ""
          }
        ]
      },
      "then": {
        "effect": "append",
        "details": [
          {
          "field": "[concat('tags[', parameters('tagName'), ']')]",
          "value": "[resourceGroup().tags[parameters('tagName')]]"
          }
        ]
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/9ea02ca2-71db-412d-8b00-7c7ca9fcd32d",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "9ea02ca2-71db-412d-8b00-7c7ca9fcd32d"
}