【发布时间】:2021-01-31 13:39:42
【问题描述】:
我有一个场景,我需要将应用程序从 DevOps 管道添加到安全组。我有以下情况很好:
- 在管道中,我有以下 powershel 脚本:
if (!((Get-AzADGroupMember -ObjectId ((Get-AzADGroup -DisplayName $groupName).id)).DisplayName -eq $appName)) {Add-AzADGroupMember -MemberObjectId (Get-AzADServicePrincipal -DisplayName $appName).id -TargetGroupObjectId (Get-AzADGroup -DisplayName $groupName).id} else {"member is already part of the group"}
- 服务主体拥有 Azure Active Directory Graph 的 API 权限和 Directory.Read.All 权限:
- 服务主体是安全组的所有者:
问题是 Azure Active Directory Graph 处于弃用路径,因此我将权限更改为推荐的 Microsoft Graph 权限:
但现在我收到“权限不足,无法完成操作”。错误
请任何人建议我还需要配置什么才能使其工作?
谢谢。
【问题讨论】:
-
未获得您的最新信息。只是想检查以下答案是否对您有帮助?如果是,您可以accept the answer,这也可以使与您有相同困惑的其他人受益,我们可以将此线程存档。另外,如果仍有任何疑问,请随时在下面发表评论:-)
标签: azure azure-devops azure-active-directory azureadgraph-deprecation adal-deprecation