Pragmatic Works Nerd News

What is Microsoft Graph?

Written by Bob Rubocki | Feb 12, 2019

In today’s post, I’d like to introduce you to Microsoft Graph. Microsoft Graph is an API that you can use to connect to various Office 365 services. It’s a single endpoint that gets you access to functionality into tools such as Exchange, OneDrive, and Teams, among others.

As Graph is a single endpoint, it’s a consolidation of all these Office 365 services into a single endpoint; previously many of these services had their own API and endpoint.

We’ve found Graph to be useful when connecting to Azure Active Directory. This is handy if I want to do things like, find out what groups a user is a member of or if I have a name of a group, who are the members of that group?

This works great when we’re using PowerApps. Based on the login of the person using PowerApps, we can see what groups they’re a part of and possibly apply security on the app and either show or hide certain functionalities within the app based on the group membership in the Azure Active Directory.

Since I brought up Active Directory, I have a note from Microsoft that I feel is important to share:

 You may have come across the Azure Active Directory Graph API, so there is a bit of confusion here. This note makes it clear that you should be using Microsoft Graph now and NOT the Azure AD Graph API.

So, note that it’s one API, one endpoint through all these services. It’s just simply Microsoft Graph and then within there we can connect to Azure Active Directory.

One handy tool available in Microsoft Graph is the Graph Explorer. This is like how you would use Postman or SoapUI for testing API calls. Check out the screenshot below:

 

Graph Explorer is a web interface that will give you an idea of what Microsoft Graph can do. It has samples based on the different services it connects to. It’s a great way to understand and explore what Graph can do.

In this example, I used it to show how I can use Graph to get my Office 365 profile information. I just put in that URL and everything was generated by the tool. I didn’t have to write any of this; I used the Get method and then Execute the Query. It then returned a preview of what the response would look like.

This way you can get an idea of how you might use Graph in your application and the format and type of data that you’re going to get back if you do execute it and use it in your application.

So, a useful API that I thought you should know is out there for you. If you have questions on Microsoft Graph or any Azure topic, you’re in the right place. Click the link below or contact us – we’d love to help with our expert knowledge on everything Azure and help take your business from good to great.