【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 )是一种开源工具,用于预配和管理云基础结构. 它将基础结构编入描述云资源拓扑的配置文件中. 这些资源包括虚拟机.存储帐户和网络接口等. ...
随机推荐
- Redis monitor命令
MONITOR Syntax MONITOR Available since: 1.0.0 Time complexity: ACL categories: @admin, @slow, @dange ...
- 从一次CPU打满到ReDos攻击和防范
作者:京东物流 刘海茂 近期碰到一起值班报警事件,web 应用服务器 CPU 消耗打到 99%,排查后发现是因为 ReDoS 导致了服务器发生了资源被耗尽.访问系统缓慢的问题,通过排查过程从而分享下 ...
- vuex4的简单使用
安装vuex cnpm install vuex@next --save 官网地址是 https://vuex.vuejs.org/zh/guide/#%E6%9C%80%E7%AE%80%E5%8D ...
- vue3中mixins的使用
vue3-mixins 在开发的过程中我们会遇见相同或者相似的逻辑代码. 可以通过vue的 mixin 功能抽离公共的业务逻辑, 然后通过impor再组件中引入.通过mixins注册进来. 这样我们就 ...
- 01uni-app的创建运行在不同端上的配置 以及tarBar的配置
uni-app的创建### 01==>创建uni-app的项目非常简单.不需要注意什么注意点哈!! 创建项目的时候 可以参考官网 https://uniapp.dcloud.io/quickst ...
- minIO系列文章04---windows下安装及在.netcore使用
一.minio下载与启动 下载后会有一个minio.exe文件,放到指定的目录 在该目录下运行:minio.exe server D:\minio\file 出现如下的提示代码启动动成功: 浏览器中 ...
- 希尔伯特变换用于解调系统——以解调调频信号为例,FM Demodulation
What's The Hilbert Transform 简单地说,希尔伯特变换的物理意义为:把信号的所有频率分量的相位推迟90度,这样原信号和变换后信号可以视为一组IQ正交信号,在数字域正交化,可以 ...
- 【JVM】运行时内存分配
程序计数器 用于标识线程执行到了字节码文件(class文件)的哪一行,当执行native方法时,值为undefined,各个线程私有 Java虚拟机栈 每个线程独有,每个方法执行时会创建一个栈帧,用于 ...
- 基于罪名法务智能知识图谱(含码源):基于280万罪名预测、20W法务问答与法律资讯问答功能
基于罪名法务智能知识图谱(含码源):基于280万罪名预测.20W法务问答与法律资讯问答功能 项目功能 目前知识图谱在各个行业中应用逐步打开,尤其在金融,医疗,法律,旅游方面.知识图谱助力法律智能,能够 ...
- Hive中Lateral view用法
1. lateral view 简介 hive函数 lateral view 主要功能是将原本汇总在一条(行)的数据拆分成多条(行)成虚拟表,再与原表进行笛卡尔积,从而得到明细表.配合UDTF函数 ...