【Azure 环境】使用 az ad group create 时候遇见 Insufficient privileges to complete the operation
问题描述
使用China Azure,通过Azure CLI 创建AAD组报错,提示权限不足 Insufficient privileges to complete the operation
# 使用这个登录:
az login --service-principal --username xxx--password xxx--tenant xxx #执行 az ad group create
az ad group create --display-name GroupTestAdministrator --mail-nickname azuretest

问题解决
为了查看更完整的错误信息,在 az ad group create 命令中添加 --debug 参数,用于输出完整的日志信息:
$ az ad group create --debug --display-name GroupTestAdministrator --mail-nickname azuretest
cli.knack.cli: Command arguments: ['ad', 'group', 'create', '--debug', '--display-name', 'GroupTestAdministrator', '--mail-nickname', 'azuretest']
cli.knack.cli: __init__ debug log: ... ...
urllib3.connectionpool: Starting new HTTPS connection (1): graph.chinacloudapi.cn:443
urllib3.connectionpool: https://graph.chinacloudapi.cn:443 "POST /xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/groups?api-version=1.6 HTTP/1.1" 403 219
msrest.http_logger: Response status: 403
msrest.http_logger: Response headers:
... ...
msrest.exceptions: Insufficient privileges to complete the operation.
查看以上错误日志,最主要的信息是在请求接口 https://graph.chinacloudapi.cn 时,报错403。而 graph.chinacloudapi.cn 是使用的旧的Azure AD Graph终结点。现在新的为 Microsoft Graph(https://microsoftgraph.chinacloudapi.cn/)。
Azure Active Directory (Azure AD) Graph 已弃用,将于近期停用。 作为此弃用路径的一部分,现在已禁用通过Azure 门户向应用注册添加 Azure AD Graph 权限。
为应用注册配置所需的 Azure AD Graph 权限:https://learn.microsoft.com/zh-cn/graph/migrate-azure-ad-graph-configure-permissions

所以,根据此文的介绍,如要继续使用 az ad group create 创建AD Group,可以修改注册应用的清单权限,来实现赋权。详细步骤见:https://learn.microsoft.com/zh-cn/graph/migrate-azure-ad-graph-configure-permissions#option-2-update-the-application-manifest-on-the-azure-portal
第一步:获取到AAD应用 Windows Azure Active Directory 或 00000002-0000-0000-c000-000000000000 下的所有Role ID。
通过Azure CLI指令: az ad sp show --id 00000002-0000-0000-c000-000000000000 , 过滤出结果zhozho能够的 Role ID。

第二步: 在AAD的注册应用中,通过清单,找到requiredResourceAccess,将 00000002-0000-0000-c000-000000000000 中获取的所有权限,以下表的方式 添加到当前 注册应用的清单中。
"requiredResourceAccess": [
{
"resourceAppId": "00000002-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "a42657d6-7f20-40e3-b6f0-cee03008a62a",
"type": "Scope"
},
{
"id": "5778995a-e1bf-45b8-affa-663a9f3f4d04",
"type": "Scope"
},
{
"id": "78c8a3c8-a07e-4b9e-af1b-b5ccab50a175",
"type": "Scope"
},
{
"id": "6234d376-f627-4f0f-90e0-dff25c5211a3",
"type": "Scope"
},
{
"id": "970d6fa6-214a-4a9b-8513-08fad511e2fd",
"type": "Scope"
},
{
"id": "311a71cc-e848-46a1-bdf8-97ff7156d8e6",
"type": "Scope"
},
{
"id": "c582532d-9d9e-43bd-a97c-2667a28ce295",
"type": "Scope"
},
{
"id": "cba73afc-7f69-4d86-8450-4978e04ecd1a",
"type": "Scope"
},
{
"id": "5778995a-e1bf-45b8-affa-663a9f3f4d04",
"type": "Role"
},
{
"id": "78c8a3c8-a07e-4b9e-af1b-b5ccab50a175",
"type": "Role"
}
]
},
{
"resourceAppId": "00000003-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "8b010b06-ce5b-41ce-bc8b-fa9acdb14371",
"type": "Scope"
}
]
}
],
参考资料
更新Azure 门户上的应用程序清单 : https://learn.microsoft.com/zh-cn/graph/migrate-azure-ad-graph-configure-permissions#option-2-update-the-application-manifest-on-the-azure-portal
【Azure 环境】使用 az ad group create 时候遇见 Insufficient privileges to complete the operation的更多相关文章
- Use Windows Azure AD to create SSO projects
Keywords Windows Azure AD, SSO Summary Use Windows Azure AD to create SSO projects Detailed Scenario ...
- 【Azure 环境】使用Microsoft Graph PS SDK 登录到中国区Azure, 命令Connect-MgGraph -Environment China xxxxxxxxx 遇见登录错误
问题描述 通过PowerShell 连接到Microsoft Graph 中国区Azure,一直出现AADSTS700016错误, 消息显示 the specific application was ...
- ASP.NET 在 Windows Azure 环境中使用基于 SQLServer 的 Session
Session 嘛,占一点儿服务器资源,但是总归比 ViewState 和 Cookie 安全点儿,所以还是要用的. Windows Azure 环境中的 Web 服务器经由负载均衡调度,根本无法保证 ...
- Azure环境中Nginx高可用性和部署架构设计
前几篇文章介绍了Nginx的应用.动态路由.配置.在实际生产环境部署时,我们需要同时考虑Nginx的高可用性和部署架构. Nginx自身不支持集群以保证自身的高可用性,商业版本的Nginx+推荐: T ...
- 部署Azure环境Web应用程序不能直接访问JSON文件解决方案
问题: 部署在Azure环境Web应用程序的JSON文件,直接通过浏览器或Web应用访问出现 404 的错误信息. 以下通过Firfox浏览器直接访问JSON文件返回的提示错误信息: “HTML 文档 ...
- 【Azure 环境】连接到微软云Azure中国区 By VS 2019, VS Code, Powershell
问题情形 最近,在使用最新的VS Code插件连接到中国区的Azure时候,出现了依旧是global版的登录连接.这个问题是当前Azure Account插件最新版的问题,可以使用V0.8.11版本登 ...
- 【Azure 环境】【Azure Developer】使用Python代码获取Azure 中的资源的Metrics定义及数据
问题描述 使用Python SDK来获取Azure上的各种资源的Metrics的名称以及Metrics Data的示例 问题解答 通过 azure-monitor-query ,可以创建一个 metr ...
- Create view failed with ORA-01031:insufficient privileges
有时候在ORACLE数据库创建视图时会遇到:ORA-01031:insufficient privileges错误,我也多次碰到了各种创建视图出错的情况,很多时候也没有太在意,今天被一同事问起这个问题 ...
- oracle, create table, insufficient privileges
SQL> exec pro_gz_day_report; ORA-01031: insufficient privileges ORA-06512: at & ...
- 【Azure 环境】在Windows系统中 使用Terraform创建中国区Azure资源步骤(入门级)
Terraform(全称:Hashicorp Terraform )是一种开源工具,用于预配和管理云基础结构. 它将基础结构编入描述云资源拓扑的配置文件中. 这些资源包括虚拟机.存储帐户和网络接口等. ...
随机推荐
- nginx 最简单的在同一个配置文件里面将http 监听的端口转发到其他端口的方法
今天发现一个问题, 我这边修改了nginx 的listen的端口之后 应用出现了问题 无法使用. 想到之前曾经试验过 tcp 的 proxy 所以就想到直接再配置文件的默认添加一句话 启动TCP的 端 ...
- [知乎]聊一聊threadlocal
作者:李二狗链接:https://www.zhihu.com/question/341005993/answer/1996544027来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载 ...
- How to Die ( Since 10.10 )
以后再也不要相信 sqrt 的精度!对 long long 级别的数取 sqrt 会炸精度! 对于区间差分 \([l,r]\) 的问题,一定要注意是否会出现 \(l>r\) 的情况!(\(|A| ...
- echarts 设置legend样式
设置legend样式 legend: { x: 'center', data: ['班车', '包车'], icon: "circle", // 这个字段控制形状 类型包括 cir ...
- ABP vNext系列文章01---模块化
一.模块化应用 1.继承AbpModule 每个模块都应该定义一个模块类.定义模块类的最简单方法是创建一个派生自AbpModule的类,如下所示: 2.配置依赖注入和其他模块---ConfigSe ...
- springboot整合nacos的入门Demo
Nacos介绍 Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service的首字母简称,一个更易于构建云原生应用的动态服务发现.配置管理和服务 ...
- 语义检索系统之排序模块:基于ERNIE-Gram的Pair-wise和基于RocketQA的CrossEncoder训练的单塔模型
语义检索系统之排序模块:基于ERNIE-Gram的Pair-wise和基于RocketQA的CrossEncoder训练的单塔模型 文本匹配任务数据每一个样本通常由两个文本组成(query,title ...
- 14.5 Socket 应用组播通信
组播通信是一种基于UDP协议的网络通信方式,它允许发送方将消息同时传递给多个接收方.在组播通信中,发送方和接收方都会加入一个共同的组播组,这个组播组对应一个特定的IP地址,所有加入该组播组的主机都能够 ...
- 试用Proxmox VE 8.0搭建云桌面系统
6月22日发布了其服务器虚拟化管理平台 Proxmox 虚拟环境的稳定版 0.12.这个主要版本基于最新的Debian 7("书虫"),并为Proxmox VE 4.8或旧版本的用 ...
- MySQL-分区表和分区介绍
一.MySQL分区简介 1.数据库分区 MySQL是一种常用的关系型数据库管理系统,分区表是一种在MySQL数据库中处理大规模数据的最佳方案之一,其主要目的是为了在特定的SQL操作中减少数据读写的总量 ...