# 资源 'myresource' 被策略禁止。策略：'允许的位置'。原因：资源位置 'eastus2' 不被允许。允许的位置：'westus', 'westus2'。

- **ID:** `policy/azure-resource-location-restriction`
- **领域:** policy
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

Azure 策略将资源部署限制在特定区域，但部署模板指定的位置不在允许列表中。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Azure Policy 2024-01-01 | active | — | — |
| ARM API 2023-09-01 | active | — | — |

## 解决方案

1. ```
   更新 ARM 模板或 Bicep 文件以使用允许的位置。示例：location: 'westus' 而不是 'eastus2'。然后重新部署。
   ```
2. ```
   通过提交支持工单或使用 Azure Policy 的豁免功能，向 Azure 策略管理员请求例外。
   ```

## 无效尝试

- **** — Dependent resources might be in a different region, leading to latency or cross-region charges. (70% 失败率)
- **** — Policy is enforced by Azure administrators; disabling it requires elevated permissions and may be audited. (90% 失败率)
- **** — Azure policies are scoped to resource types and locations; changing the name does not affect the policy evaluation. (95% 失败率)
