graphAPI : Add azureAD group to enterprise app using grapAPI

Azad Patel 1 Reputation point
2021-08-11T17:44:38.95+00:00

Hi Team,

I would like to know if there is any GraphAPI for Adding azureAD group to enterprise app.

122754-image.png

If yes please share the documentation link.

Thanks,
Azad

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,716 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 37,456 Reputation points
    2021-08-12T03:01:07.763+00:00

    You should want to assign appRoles to users or groups. You can use the /appRoleAssignments endpoint to grant appRoles to groups.

    POST https://graph.microsoft.com/v1.0/groups/{id}/appRoleAssignments  
    Content-Type: application/json  
    Content-Length: 110  
      
    {  
      "principalId": "principalId-value",  
      "resourceId": "resourceId-value",  
      "appRoleId": "appRoleId-value"  
    }  
    

    principalId: your group id.

    resourceId: Object ID of the application.

    122478-image.png

    appRoleId: The id of the appRole you created.

    122527-image.png

    122556-image.png

    122485-269.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    2 people found this answer helpful.