How to get appRoleAssignedTo for Microsoft Azure Applications?

Shambhavi Rai 96 Reputation points
2021-05-25T07:41:56.453+00:00

I am trying to get appRoleAssignedTo for my Azure Tenant, now suppose if I have 10 applications under that tenant I will have to make 10 different calls by passing the servicePrincipal Id for all the 10 applications.

GET /servicePrincipals/{id}/appRoleAssignedTo

Is there a way through which I can get all the appRoleAssignedTo under respective servicePrincipal using just one API call.

Alternatively Microsoft provides a delta call for servicePrincipal, is there a way that the delta returns me the servicePrincipal when appRoleAssignedTo has changed(basically connecting the appRolesAssignedTo to servicePrincipal) P.S I have tried doing it using $select and $expand and it doesn't work.

https://learn.microsoft.com/en-us/graph/api/serviceprincipal-list-approleassignments?view=graph-rest-1.0&tabs=http

https://learn.microsoft.com/en-us/graph/api/serviceprincipal-delta?view=graph-rest-1.0&tabs=http

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,589 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,206 Reputation points
    2021-05-25T08:38:53.863+00:00

    Hi @Shambhavi Rai · Thank you for reaching out.

    You can combine multiple GET calls of Graph API into one call by using JSON Batching, as mentioned below:

    Call:

    POST `https://graph.microsoft.com/v1.0/$batch`  
    

    Body:

    {  
      "requests": [  
        {  
          "id": "1",  
          "method": "GET",  
          "url": "..."  
        },  
        {  
          "id": "2",  
          "dependsOn": [ "1" ],  
          "method": "GET",  
          "url": "..."  
        },  
        {  
          "id": "3",  
          "method": "GET",  
          "url": "..."  
        },  
        {  
          "id": "4",  
          "dependsOn": [ "2" ],  
          "method": "GET",  
          "url": "..."  
        }  
      ]  
    }  
    

    Read More: Combine multiple requests in one HTTP call using JSON batching

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.