我正在尝试使用Graph版本为企业应用程序创建角色分配。
我正在跟踪Microsoft文档来进行同样的操作。
错误:
这是我在检查时遇到的错误:
只有在包含的实体中才支持写入请求。
我使用Azure (graph.windows.net)进行了同样的尝试,并且我能够实现以下功能。
{
"error": {
"code": "BadRequest",
"message": "Write requests are only supported on contained entities",
"innerError": {
"request-id": "f8b80735-c516-4a65-9f42-2b3088f2951a",
"date": "2019-07-30T09:23:13"
}
}
}发布于 2019-07-31 07:05:16
我可以通过Microsoft复制您的问题,不确定问题的原因是什么。也是,它是一个Beta版本,我不建议您在生产环境中使用它。
Azure为我工作,您可以参考下面的请求示例。
注意事项:id是由目标资源应用程序resourceId在其appRoles属性中声明的角色id。我的示例应用程序不声明任何权限,因此我指定了默认id (零GUID 00000000-0000-0000-0000-000000000000)。
POST https://graph.windows.net/myorganization/servicePrincipals/<objetc id of the service principal>/appRoleAssignments?api-version=1.6
{
"id":"00000000-0000-0000-0000-000000000000",
"principalId":"<object id of the user/group/service principal being granted the access>",
"resourceId":"<objetc id of the service principal which the assignment was made>"
}

https://stackoverflow.com/questions/57284171
复制相似问题