Skip to content

Latest commit

 

History

History
154 lines (110 loc) · 5.64 KB

File metadata and controls

154 lines (110 loc) · 5.64 KB
title List appRoleAssignments granted to a service principal
description Retrieve the list of app role assignments granted to a service principal.
ms.localizationpriority high
doc_type apiPageType
ms.subservice entra-applications
author eringreenlee
ms.date 10/15/2024

List appRoleAssignments granted to a service principal

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Retrieve the list of appRoleAssignment that have been granted to a service principal.

App roles that are assigned to service principals are also known as application permissions. Application permissions can be granted directly by creating app role assignments, or through a consent experience.

Note This request might have replication delays for app role assignments that were recently granted or removed.

[!INCLUDE national-cloud-support]

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

[!INCLUDE rbac-approleassignments-apis-read]

HTTP request

GET /servicePrincipals/{id}/appRoleAssignments

Optional query parameters

This method supports the OData query parameters to help customize the response.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

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

Example

Request

The following example shows a request to retrieve the app roles that have been assigned to a service principal.

GET https://graph.microsoft.com/beta/servicePrincipals/8e881353-1735-45af-af21-ee1344582a4d/appRoleAssignments

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#appRoleAssignments",
  "value": [
    {
      "id": "UxOIjjUXr0WvIe4TRFgqTY4z9Wu5KxpBtlEpoTGjw-A",
      "creationTimestamp": "2021-02-02T04:22:45.4980259Z",
      "appRoleId": "e2a3a72e-5f79-4c64-b1b1-878b674786c9",
      "principalDisplayName": "dxprovisioning-graphapi-client",
      "principalId": "8e881353-1735-45af-af21-ee1344582a4d",
      "principalType": "ServicePrincipal",
      "resourceDisplayName": "Microsoft Graph",
      "resourceId": "fea94d6d-b5bf-44d2-a887-4f72a8d74f44"
    }
  ]
}