last sync: 2020-Jul-15 14:17:33 UTC

Azure Policy

Require a tag on resource groups

Policy DisplayName Require a tag on resource groups
Policy Id 96670d01-0a4d-4649-9c89-2d3abc0a5025
Policy Category Tags
Policy Description Enforces existence of a tag on resource groups.
Policy Mode All
Policy Type BuiltIn
Policy in Preview FALSE
Policy Deprecated FALSE
Policy Effect Fixed: deny
Roles used none
Policy Changes
Date/Time (UTC ymd) (i) Change Change detail
2020-03-10 16:29:49 change: DisplayName previous DisplayName: Require specified tag on resource groups
Used in Policy Initiative(s) none
Policy Rule
{
  "properties": {
    "displayName": "Require a tag on resource groups",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "Enforces existence of a tag on resource groups.",
    "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": "type",
            "equals": "Microsoft.Resources/subscriptions/resourceGroups"
          },
          {
          "field": "[concat('tags[', parameters('tagName'), ']')]",
            "exists": "false"
          }
        ]
      },
      "then": {
        "effect": "deny"
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/96670d01-0a4d-4649-9c89-2d3abc0a5025",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "96670d01-0a4d-4649-9c89-2d3abc0a5025"
}