{
  "id": "policy/azure-policy-tagging-enforcement-failure",
  "signature": "Resource 'myresource' was disallowed by policy. Policy: 'Require a tag on resources'. Reason: 'The resource has no tags.'",
  "signature_zh": "资源 'myresource' 被策略禁止。策略：'要求在资源上添加标签'。原因：'该资源没有标签。'",
  "regex": "Resource '.*' was disallowed by policy\\. Policy: 'Require a tag on resources'\\. Reason: 'The resource has no tags\\.'",
  "domain": "policy",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Azure Policy initiative requires specific tags on all resources; missing tags cause deployment denial.",
  "root_cause_type": "generic",
  "root_cause_zh": "Azure 策略计划要求所有资源具有特定标签；缺少标签导致部署被拒绝。",
  "versions": [
    {
      "version": "Azure CLI 2.57.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Azure Policy 1.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Redeploy the resource without any changes, hoping the policy is temporary.",
      "why_fails": "Azure Policy is persistent and evaluated on every deployment; the same error will occur.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Remove the resource group and recreate it.",
      "why_fails": "The policy is applied at subscription or management group level, not resource group. Deleting the group doesn't remove the policy requirement.",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    },
    {
      "action": "Add tags after deployment via Azure Portal.",
      "why_fails": "The policy blocks the deployment itself; the resource is never created to add tags later.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add required tags in the deployment template. For ARM templates, add 'tags': { 'Environment': 'Production' } in the resource definition.",
      "success_rate": 0.9,
      "how": "Add required tags in the deployment template. For ARM templates, add 'tags': { 'Environment': 'Production' } in the resource definition.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use Azure CLI to deploy with tags: 'az deployment group create --resource-group myRG --template-file template.json --parameters tags={Environment:Production}'",
      "success_rate": 0.85,
      "how": "Use Azure CLI to deploy with tags: 'az deployment group create --resource-group myRG --template-file template.json --parameters tags={Environment:Production}'",
      "condition": "",
      "sources": []
    },
    {
      "action": "Request policy exemption for the resource group from Azure Policy team via: 'az policy exemption create --name myExemption --policy-assignment <assignment-id> --scope /subscriptions/<sub-id>/resourceGroups/<rg>'",
      "success_rate": 0.7,
      "how": "Request policy exemption for the resource group from Azure Policy team via: 'az policy exemption create --name myExemption --policy-assignment <assignment-id> --scope /subscriptions/<sub-id>/resourceGroups/<rg>'",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add required tags in the deployment template. For ARM templates, add 'tags': { 'Environment': 'Production' } in the resource definition.",
    "Use Azure CLI to deploy with tags: 'az deployment group create --resource-group myRG --template-file template.json --parameters tags={Environment:Production}'",
    "Request policy exemption for the resource group from Azure Policy team via: 'az policy exemption create --name myExemption --policy-assignment <assignment-id> --scope /subscriptions/<sub-id>/resourceGroups/<rg>'"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://learn.microsoft.com/en-us/azure/governance/policy/overview",
  "official_doc_section": null,
  "error_code": "Conflict",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-11-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}