List governanceRoleAssignments

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Caution

This version of the Privileged Identity Management (PIM) API for Azure Resource roles will be deprecated soon. Please use the new Azure REST PIM API for Azure resource roles.

Retrieve a collection of governanceRoleAssignments.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Azure resources

Permission type Permissions
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureResources
Delegated (personal Microsoft account) Not supported.
Application PrivilegedAccess.Read.AzureResources

Azure AD

Permission type Permissions
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureAD
Delegated (personal Microsoft account) Not supported.
Application PrivilegedAccess.Read.AzureAD

Groups

Permission type Permissions
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureADGroup
Delegated (personal Microsoft account) Not supported.
Application PrivilegedAccess.Read.AzureADGroup

HTTP request

List a collection of governanceRoleAssignments on a resource.

Note: Besides the permission scope, this request requires the requestor to have at least one role assignment on the resource.

GET /privilegedAccess/azureResources/resources/{resourceId}/roleAssignments
GET /privilegedAccess/azureResources/roleAssignments?$filter=resourceId+eq+'{resourceId}'

List a collection of governanceRoleAssignments of mine.

GET /privilegedAccess/azureResources/roleAssignments?$filter=subjectId+eq+'{myId}'

Optional query parameters

This method supports the OData Query Parameters to help customize the response.

Request headers

Name Description
Authorization Bearer {code}

Request body

Do not supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a collection of governanceRoleAssignment objects in the response body.

Example

This example shows how to get my role assignments on the subscription Wingtip Toys - Prod.

Request
GET https://graph.microsoft.com/beta/privilegedAccess/azureResources/roleAssignments?$filter=subjectId+eq+'918e54be-12c4-4f4c-a6d3-2ee0e3661c51'
Response
HTTP/1.1 200 OK
Content-type: application/json
Content-Length: 2062

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#governanceRoleAssignments",
    "value": [
        {
            "id": "20f4157d-5837-4356-9630-ebd3a832f227",
            "resourceId": "fb016e3a-c3ed-4d9d-96b6-a54cd4f0b735",
            "roleDefinitionId": "bc75b4e6-7403-4243-bf2f-d1f6990be122",
            "subjectId": "918e54be-12c4-4f4c-a6d3-2ee0e3661c51",
            "linkedEligibleRoleAssignmentId": null,
            "externalId": null,
            "startDateTime": "2018-03-13T01:19:08.59Z",
            "endDateTime": "2018-06-11T01:18:37.08Z",
            "memberType": "Direct",
            "assignmentState": "Eligible",
            "status": "Provisioned"
        },
        {
            "id": "e327f4be-42a0-47a2-8579-0a39b025b394",
            "resourceId": "e5e7d29d-5465-45ac-885f-4716a5ee74b5",
            "roleDefinitionId": "8b4d1d51-08e9-4254-b0a6-b16177aae376",
            "subjectId": "918e54be-12c4-4f4c-a6d3-2ee0e3661c51",
            "linkedEligibleRoleAssignmentId": null,
            "externalId": null,
            "startDateTime": "2018-03-28T16:56:48.243Z",
            "endDateTime": "2018-09-24T16:56:30.547Z",
            "memberType": "Direct",
            "assignmentState": "Eligible",
            "status": "Provisioned"
        },
        ...
  ]
}