Export governanceRoleAssignmentRequests

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 resources will be deprecated soon. Please use the new Azure REST PIM API for Azure resource roles.

Retrieve a collection of governanceRoleAssignmentRequests in the format application/octet-stream, which can be parsed as a .csv file in the browser.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

The following table shows the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Supported resource Delegated (work or school account) Delegated (personal Microsoft account) Application
Microsoft Entra ID PrivilegedAccess.ReadWrite.AzureAD Not supported. PrivilegedAccess.Read.AzureAD
Azure resources PrivilegedAccess.ReadWrite.AzureResources Not supported. PrivilegedAccess.Read.AzureResources
group PrivilegedAccess.ReadWrite.AzureADGroup Not supported. PrivilegedAccess.Read.AzureADGroup

The requestor must also have at least one role assignment on the resource.

HTTP request

Export a collection of governanceRoleAssignmentRequests on a resource.

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

Export a collection of governanceRoleAssignmentRequests for the signed-in user.

GET /privilegedAccess/azureResources/roleAssignments/export?$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

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and content of type application/octet-stream.

Example

This example saves all role assignments as a .csv file in the subscription Wingtip Toys - Prod.

Request
GET https://graph.microsoft.com/beta/privilegedAccess/azureResources/roleAssignments/export?filter=resourceId+eq+'85dfe48a-55d3-49fc-8f36-ee14b7f6f720'
Response

The following example shows the response.

HTTP/1.1 200 OK
Content-Type:application/octet-stream
Content-Length:126

77u/77u/QXNzaWdubWVudCBMZXZlbCxVc2VyIEdyb3VwIE5hbWUsUm9sZSBOYW1lLEVtYWlsLEFzc2lnbm1lbnQgVHlwZSxBc3NpZ25tZW43IFN0YXJ0IFRpbWUgKFVUQyksQXNzaWdubWVudCBFbmQgVGltZdAoVVRDKQ0K