Not able to get list of all users who have been assigned to a app role using graph api

MAQBOOL SHAIK 0 Reputation points
2023-07-12T09:24:46.09+00:00

Title: How to retrieve a list of users assigned to a specific app role using Microsoft Graph API?

Question: I have an app that has Read and Write roles assigned to it. I'm looking for guidance on how to retrieve a list of all users assigned to the Write role using Microsoft Graph API. Can someone provide an example or guide me through the steps? Below is an image of the user interface for reference:

User's image

Thanks in advance!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,047 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,245 questions
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 45,186 Reputation points
    2023-07-13T02:55:34.6733333+00:00

    Hi @MAQBOOL SHAIK

    You can retrieve a list of appRoleAssignment s for a user, group, or client service principal that have been granted for a given application service principal by calling the /appRoleAssignedTo graph API.

    GET /servicePrincipals/{id}/appRoleAssignedTo
    GET /servicePrincipals(appId='{appId}')/appRoleAssignedTo
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.