Get governanceRoleAssignment

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 the properties and relationships of a governanceRoleAssignment.

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

  1. Get a governanceRoleAssignment on a resource

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

GET /privilegedAccess/azureResources/resources/{resourceId}/roleAssignments/{id}
GET /privilegedAccess/azureResources/roleAssignments/{id}?$filter=resourceId+eq+'{resourceId}'
  1. Get a governanceRoleAssignment of mine
GET /privilegedAccess/azureResources/roleAssignments/{id}?$filter=subjectId+eq+'{myId}'

Optional query parameters

This method does not supports OData Query Parameters other than $filter 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 governanceRoleAssignment object in the response body.

Example

Get a governanceRoleAssignment on subscription "Wingtip Toys - Prod"

Request
GET https://graph.microsoft.com/beta/privilegedAccess/azureResources/roleAssignments/0ba78f41-ee7a-4227-adb9-1499431b2164?$filter=resourceId+eq+'e5e7d29d-5465-45ac-885f-4716a5ee74b5'
Response
HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#governanceRoleAssignments/$entity",
    "id": "0ba78f41-ee7a-4227-adb9-1499431b2164",
    "resourceId": "e5e7d29d-5465-45ac-885f-4716a5ee74b5",
    "roleDefinitionId": "8b4d1d51-08e9-4254-b0a6-b16177aae376",
    "subjectId": "74487eb5-1630-4fa8-9581-0bb076ea5de3",
    "linkedEligibleRoleAssignmentId": null,
    "externalId": null,
    "startDateTime": "2018-01-22T23:47:19.687Z",
    "endDateTime": "2018-07-21T23:47:02.887Z",
    "memberType": "Direct",
    "assignmentState": "Eligible",
    "status": "Provisioned"
}