无法使用Beta Graph API删除AppRoleAssignment

时间:2019-04-30 00:40:40

标签: microsoft-graph

我正在使用Graph API beta端点尝试删除AppRoleAssigmnet:

https://graph.microsoft.com/beta/appRoleAssignments/I9pzftcx_06aCwX8sV9cmziqx-oiF21IlkxV9xRYvBM

我正在使用DELETE动词,下面是我得到的回复:

109
{
  "error": {
    "code": "Request_UnsupportedQuery",
    "message": "Direct queries to this resource type are not supported.",
    "innerError": {
      "request-id": "aa7c14a3-f700-4368-898e-009f1608ade1",
      "date": "2019-04-30T00:29:50"
    }
  }
}
0

根据Beta文档,这是允许的:

https://docs.microsoft.com/en-us/graph/api/approleassignment-delete?view=graph-rest-beta

我还根据文档验证了正确的权限。

我知道这是一个beta终结点,但有机会尽快解决,还是我需要使用Azure AD API?

更新

我尝试遍历用户集合,但也失败了:

https://graph.microsoft.com/beta/users/7e73da23-31d7-4eff-9a0b-05fcb15f5c9b/appRoleAssignments/I9pzftcx_06aCwX8sV9cmziqx-oiF21IlkxV9xRYvBM

我正在使用DELETE动词,下面是我得到的回复:

fb
{
  "error": {
    "code": "BadRequest",
    "message": "Write requests are only supported on contained entities",
    "innerError": {
      "request-id": "b6db0eee-dc45-4e10-a56c-9a870fb7315c",
      "date": "2019-04-30T23:49:24"
    }
  }
}
0

我尝试遍历服务主体集合,但也失败了:

https://graph.microsoft.com/beta/servicePrincipals/27e0a182-2008-4b4e-b998-731e0d111041/appRoleAssignments/I9pzftcx_06aCwX8sV9cmziqx-oiF21IlkxV9xRYvBM

我正在使用DELETE动词,下面是我得到的回复:

18b
{
  "error": {
    "code": "BadRequest",
    "message": "The type 'microsoft.graph.appRoleAssignment' does not inherit from and is not a base type of 'microsoft.graph.directoryObject'. The type of 'KeySegments' must be related to the Type of the EntitySet.",
    "innerError": {
      "request-id": "8c981e82-755e-4c25-b448-58d2b71e12c7",
      "date": "2019-04-30T23:46:20"
    }
  }
}
0

1 个答案:

答案 0 :(得分:1)

恐怕此服务错误已存在很长时间了。我唯一能说的就是尝试使用AAD Graph进行此操作,直到在Microsoft Graph中解决此问题为止。不幸的是,该架构将appRoleAssignments建模为标准关系,而实际上它是作为一个包含的实体实现的(即,当应用程序角色分配作为另一个实体的一部分(例如用户,用户组或servicePrincipals)包含时,您只能对其进行操作。模式定义需要更新。该文档是准确的恕我直言。

希望这会有所帮助