当我 运行 appRoleAssignments 时,它 returns 不明确的回应

when i run appRoleAssignments, it returns the unclear response

我尝试将 appRole 分配给 servicePrincipal,但得到了一些奇怪的响应: url 是 https://graph.microsoft.com/beta/servicePrincipals/{id}/appRoleAssignments 与

{
  "principalDisplayName": "[displayName]",
  "principalId": "[Guid]",
  "principalType": "ServicePrincipal",
  "resourceDisplayName": "Microsoft.Azure.ActiveDirectory",
  "resourceId": "a774ef19-d0c7-4305-8317-8aa6a1f06634"
} 

这是回复

{
    "error": {
        "code": "BadRequest",
        "message": "Write requests are only supported on contained entities",
        "innerError": {
            "request-id": "2be2ae24-a9d9-4699-b72a-68f2feb12f8d",
            "date": "2017-08-17T18:10:07"
        }
    }
}

如果我将 url 更改为 https://graph.microsoft.com/beta/appRoleAssignments 使用相同的请求正文,它 returns

{
    "error": {
        "code": "Request_ResourceNotFound",
        "message": "Resource 'CBVUPR3WYk-2780vOjxKdw' does not exist or one of its queried reference-property objects are not present.",
        "innerError": {
            "request-id": "9b1aaae6-3178-4db3-8a2b-1a025d69bbda",
            "date": "2017-08-17T18:18:05"
        }
    }
}

对此有什么想法吗?

谢谢

不幸的是,我认为目前这很糟糕。此 API 有一个重大错误 - 因为 API 没有为您提供设置您尝试分配的 appRoleId 的方法。我没有确定何时修复此问题的预计到达时间。同时,AAD Graph API 是唯一可用的选项。

希望对您有所帮助,