last sync: 2021-Sep-24 16:09:49 UTC

Azure Policy definition

Require a tag on resources

Name Require a tag on resources
Azure Portal
Id 871b6d14-10aa-478d-b590-94f262ecfa99
Version 1.0.1
details on versioning
Category Tags
Microsoft docs
Description Enforces existence of a tag. Does not apply to resource groups.
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Fixed: deny
Used RBAC Role none
History
Date/Time (UTC ymd) (i) Change type Change detail
2020-03-10 16:29:49 change Previous DisplayName: Require specified tag
Used in Initiatives none
JSON
{
  "displayName": "Require a tag on resources",
  "policyType": "BuiltIn",
  "mode": "Indexed",
  "description": "Enforces existence of a tag. Does not apply to resource groups.",
  "metadata": {
    "version": "1.0.1",
    "category": "Tags"
  },
  "parameters": {
    "tagName": {
      "type": "String",
      "metadata": {
        "displayName": "Tag Name",
        "description": "Name of the tag, such as 'environment'"
      }
    }
  },
  "policyRule": {
    "if": {
      "field": "[concat('tags[', parameters('tagName'), ']')]",
      "exists": "false"
    },
    "then": {
      "effect": "deny"
    }
  }
}