Microsoft Graph API can be used to connect and manage the Office 365 SaaS platforms such as SharePoint Online, Office 365 Groups, One Drive, OneNote, Azure AD, Teams (in beta) and much more.
A Graph app is an Azure AD app that has privileges (with provided permissions) to authenticate and then execute operations when using PowerShell, Azure Functions, Flow, Office Online CSOM, SharePoint Online and many other tools.
It is quite easy to set up a graph app, below is a brief preview of the process.
1. Go to the following link in your tenancy – https://apps.dev.microsoft.com/ and create an App. Below a brief screenshot of the App registration page.
- Then, first create a password and make sure to copy the password because it will be shown that time only. Also copy the App ID later for any future use.
3. Then select the platforms that will be used to call the Graph app. For web calls use Web and for PowerShell scripts use Native as platform. You can leave the fields in the apps blank unless there is a specific endpoint that you would like to refer to. More information is provided at this link – https://developer.microsoft.com/en-us/graph/docs/concepts/auth_register_app_v2
Note: Turn off “Allow Implicit Flow” for web calls
4. Add the owners that could manage the App in Azure AD.
5. Next, select the proper application permissions that the App will need to run the actions. These settings are very important for your app to do the right calls, so try to set the appropriate settings. In some cases, it might be necessary to trial various app permission levels till you get it correct.
Note: For admin programs or scripts, it will be necessary to get Admin consent to the url below
https://login.microsoftonline.com//adminconsent?client_id=[clientid]&state=[something]
6. Leave the other fields as is and create the App. We can turn off the ‘Live SDK support’ if not needed
7. The App will show up in the Apps home page once created
After the Graph app is created, we can use to perform various operations on Office 365 platforms. More details of the various operations are detailed here – https://developer.microsoft.com/en-us/graph/docs/concepts/overview.
There is also the beta release (https://graph.microsoft.com/beta/) which has more features upcoming in Graph Api.
Conclusion:
In the above blog, how we can create an Graph App that will allow us to connect to Graph Api and do operations with it.