Is there a way to add a group or a user to Enterprise Apps in Azure using Graph API ? Was looking for available properties in Beta and 1.0 but couldn't find this option.
Is there a way to add a group or a user to Enterprise Apps in Azure using Graph API ? Was looking for available properties in Beta and 1.0 but couldn't find this option.
To assign user/group to app using Graph API you could use the below endpoint :
POST https://graph.microsoft.com/v1.0/users/{id}/appRoleAssignments
Content-Type: application/json
Content-Length: 110
{
"principalId": "principalId-value",
"resourceId": "resourceId-value",
"appRoleId": "appRoleId-value"
}
Reference : https://docs.microsoft.com/en-us/graph/api/user-post-approleassignments?view=graph-rest-1.0&tabs=http
{id}- id/upn of the user of the user
"principalId" - id/upn of the user of the user
resourceId - Id of the app, you can get it from the portal
Azure Active Directory >> App Registrations >> Select All Apps from the dropdown menu >> find your app and click on it.
appRoleId
To get the ApproleID
Azure Active Directory >> App Registrations >> Select All Apps from the dropdown menu >> find your app and click on it >> App Roles | Preview
Or using Graph
https://graph.microsoft.com/v1.0/applications/{id}?$select=displayName, appId,appRoles
If I don't misunderstand, you would like to assign users and groups for an app. And you followed this Quickstart in the portal.
There are three methods to assign or unassign users, and groups, for an app. See here:
using the Azure portal
using the Graph API
using PowerShell