gpt4 book ai didi

Azure 应用程序注册通过 powershell Azure CLI 添加授权的客户端应用程序

转载 作者:行者123 更新时间:2023-12-03 07:09:06 24 4
gpt4 key购买 nike

如何在使用 powershell Azure CLI 注册应用程序期间添加授权客户端应用程序(在门户中:应用程序注册 -> 公开 API -> 添加授权客户端应用程序)。

最佳答案

没有 az 命令可以直接将预授权客户端添加到应用注册,相反,您必须使用 Graph API(测试版)来更新与 Graph Explorer 相同 az rest 命令。

使用 az 命令获取 OauthPermissionId :

az ad app show --id $appId --query "oauth2Permissions[].id"

我在 Graph Explorer 中进行了相同的测试:

enter image description here

Ran Patch : https://graph.microsoft.com/beta/applications/<appObjectId>

请求正文为:

{
"api": {
"preAuthorizedApplications": [
{
"appId": "authorizedappClientID",
"permissionIds": [
"oauth2PermissionId"
]
}
]
}
}

enter image description here

输出:

enter image description here

az rest 的引用可以在 SO thread 中找到王怡回答。

关于Azure 应用程序注册通过 powershell Azure CLI 添加授权的客户端应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70786187/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com