You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

创建地理阻断Azure条件访问策略时遇InvalidControls错误求助

解决Azure条件访问策略地理阻断配置的InvalidControls错误

你遇到的InvalidControls错误,核心原因是授权控制(grantControls)未配置有效规则。你的JSON配置中,grantControls下的所有控制数组均为空,而Azure要求条件访问策略必须指定至少一个有效的授权或阻止动作。

修正方案

要实现地理阻断,需在grantControls.builtInControls中添加"block"动作,这是Azure内置的登录阻止控制。修改后的完整JSON配置如下:

{
    "displayName": "Netsmart - <RING> - Geoblock - Outside US & Canada",
    "createdDateTime": null,
    "modifiedDateTime": null,
    "state": "enabledForReportingButNotEnforced",
    "sessionControls": null,
    "conditions": {
        "signInRiskLevels": [],
        "clientAppTypes": ["All"],
        "platforms": null,
        "locations": {
            "excludeLocations": ["15b3734a-b51f-4aa9-b76d-4d3a137222ba", "18bde4b6-cb0d-45ea-8058-9578d3ace326"],
            "includeLocations": ["All"]
        },
        "deviceStates": null,
        "applications": {
            "includeApplications": ["All"],
            "excludeApplications": [],
            "includeUserActions": []
        },
        "users": {
            "includeUsers": ["All"],
            "excludeUsers": [],
            "includeGroups": [],
            "excludeGroups": [],
            "includeRoles": [],
            "excludeRoles": []
        }
    },
    "grantControls": {
        "operator": "OR",
        "builtInControls": ["block"],
        "customAuthenticationFactors": [],
        "termsOfUse": []
    }
}

关键说明

  1. 控制规则修正:添加"block"后,Azure会对符合条件(美国、加拿大以外地区登录)的请求执行阻止操作,满足地理阻断需求。
  2. 位置ID验证:你配置的excludeLocations中的ID是Azure内置的美国和加拿大位置ID,无需修改。
  3. 测试建议:保持state为enabledForReportingButNotEnforced,先通过Azure AD条件访问报告验证策略触发逻辑,确认无误后再改为enabled启用强制规则。

内容的提问来源于stack exchange,提问作者sionnach

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 22:22:38