{
  "id": "policy/azure-resource-location-not-allowed",
  "signature": "Resource 'myresource' was disallowed by policy. Policy: 'Allowed locations'. Reason: 'The resource location 'eastus2' is not allowed.'",
  "signature_zh": "资源 'myresource' 被策略禁止。策略：'允许的位置'。原因：'资源位置 'eastus2' 不被允许。'",
  "regex": "Resource '.*' was disallowed by policy\\. Policy: 'Allowed locations'\\. Reason: 'The resource location '.*' is not allowed\\.'|was disallowed by policy.*Allowed locations",
  "domain": "policy",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Azure Policy 'Allowed locations' restricts resource deployment to specific regions, and the requested location is not in the allowed list.",
  "root_cause_type": "generic",
  "root_cause_zh": "Azure 策略“允许的位置”将资源部署限制在特定区域，而请求的位置不在允许列表中。",
  "versions": [
    {
      "version": "Azure Policy",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Azure Resource Manager",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Azure CLI 2.50+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform azurerm 3.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Azure Policy evaluates at deployment time; any location not in the allowed list will be rejected. The policy is enforced at the subscription or management group level.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This requires high-level permissions (Owner or Policy Contributor) and may violate organizational compliance. It's not a viable workaround for most developers.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Deploy the resource to an allowed location. Use Azure CLI to list allowed locations: az policy assignment list --query \"[?displayName=='Allowed locations'].properties.parameters.listOfAllowedLocations.value\" -o tsv. Then redeploy to one of those regions.",
      "success_rate": 0.9,
      "how": "Deploy the resource to an allowed location. Use Azure CLI to list allowed locations: az policy assignment list --query \"[?displayName=='Allowed locations'].properties.parameters.listOfAllowedLocations.value\" -o tsv. Then redeploy to one of those regions.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Request an exception to the policy from the Azure Policy administrator via a change request or by updating the policy assignment to include the desired location.",
      "success_rate": 0.7,
      "how": "Request an exception to the policy from the Azure Policy administrator via a change request or by updating the policy assignment to include the desired location.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Deploy the resource to an allowed location. Use Azure CLI to list allowed locations: az policy assignment list --query \"[?displayName=='Allowed locations'].properties.parameters.listOfAllowedLocations.value\" -o tsv. Then redeploy to one of those regions.",
    "Request an exception to the policy from the Azure Policy administrator via a change request or by updating the policy assignment to include the desired location."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://learn.microsoft.com/en-us/azure/governance/policy/samples/allowed-locations",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.89,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2023-05-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}