问题描述
我正在尝试设置托管标识(系统分配),分配委托权限(如 Tasks.ReadWrite),然后使用它来调用 Graph Api。
我使用以下代码识别了对象 ID:
$app = Get-AzureADServicePrincipal -All $true -Filter "AppId eq '00000003-0000-0000-c000-000000000000'"
$role = $app.Oauth2Permissions | where-Object { $_.AdminConsentdisplayName -eq "Create,read,update,and delete user’s tasks and task lists" }
但是当我运行以下命令时:
New-AzureADServiceAppRoleAssignment -Id $role.Id -ObjectId $miObjectID -PrincipalId $miObjectID -ResourceId $app.ObjectId
其中 $miObjectID 是我的托管身份 ID,我收到以下错误消息:
New-AzureADServiceAppRoleAssignment : Error occurred while executing NewServicePrincipalAppRoleAssignment
Code: Request_BadRequest
Message: Permission being assigned was not found on application
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)