Configuring Pre-consent (Native App for Graph API)
Configure pre-consent for the native app that you created for the Graph API:
- On a machine having Microsoft Online Services Sign-in Assistant (64-bit version) and Windows Azure Active Directory Module for Windows PowerShell (version 1.1.166.0) installed, open a Windows PowerShell command prompt session.
-
Run the following command:
Connect-MsolService
You will then be prompted for your credentials. Log in using the credentials of the user with the Global Admin permissions in your CSP account’s Azure Active Directory.
-
Run the following command:
Get-MsolGroup | Where-Object {$_.DisplayName -like "AdminAgents"}
From the command output, write down the Object ID of the AdminAgents group.
-
Run the following command:
Get-MsolServicePrincipal | Where-Object {$_.AppPrincipalId -like "APP_ID_OF_NATIVE_APP_FOR_GRAPH_API"}
From the command output, write down the Object ID of the native app.
-
Run the following command:
Add-MsolGroupMember -GroupObjectId OBJECT_ID_OF_ADMIN_AGENT_GROUP -GroupMemberType ServicePrincipal -GroupMemberObjectId OBJECT_ID_OF_NATIVE_APP_FOR_GRAPH_API