I want to write about Microsoft Graph for a while, which is the perfect way to start, in my opinion. Let’s explore what it is, what it can do, and what we can fully use to the advantage of its features.
Please note that Microsoft Graph is a bit more advanced than the Power Platform, so you need to understand concepts like API, endpoints, and others to use it. We’ll focus on the “big picture” today and will go into more detail in future articles.
What’s Microsoft Graph
Microsoft Graph is a single gateway to all Microsoft Services. The team did a great job by enabling one single endpoint, https://graph.microsoft.com/ to access the whole set of APIs that you can use to access:
- Microsoft 365 services
- Windows 10
- Enterprise Security
This image from Microsoft tells a lot about what it can do, and it fits in the echo-system.
Think about Microsoft Graph as the single place where you query the whole platform. Neat right?
What it can do
There’s a lot to cover, and I won’t go into detail since this is an introductory article, but I want to show you some things you can explore without setting up complex environments or tools to do it.
First, let’s go to https://developer.microsoft.com/en-us/graph and pick the “Graph Explorer.”
As a side-note, more companies should adopt this strategy. Provide a simple portal where developers can explore the endpoints, the data that they return, and the permissions needed to access them.
It starts with “me.”
Then you go to the portal; this is what you see.
You have a simple UI where you can pick the information you want to explore, the type of request, and some examples. Let’s start with the first one. My information:
Notice that you get a lot of information about the person, some that you can find, for example, in the Power Automate’s actions, but this way you can do a lot more with it and are not restricted to any tool.
Microsoft provides you with code snippets that you can copy and speed up your development time.
But where this really shines is in the “Adaptive Cards.” Most of the time, you have the data but don’t know how to use an Adaptive Card. The Graph Explorer not only shows you the preview of the card as well as the code to do it.
To build that card, you can use the following template.
Of course, you can use the Adaptive Card Designer, but exploring the data and getting all of this for free can speed up the process from your idea into having something done.
There’s a lot to explore
Microsoft provides endpoints for a lot of its products and platforms:
Things like getting your “To Do Task List,” “Getting the Charts in an Excel Worksheet,” or “Getting all your events for next week” are some of the things that you can do. To do them, you need to authenticate and, for some, you need parameters to define better what you want.
I want to show you something even better than that. All platforms have built-in permissions so that you can (or not) access the information. If you click an endpoint and get an error message because you don’t have permissions, you would need:
- Go deep into the permissions in Azure AD, for example.
- Ask your administrator to do that for you.
It would be even trickier if you don’t know what permission you need to enable the feature. So Microsoft thought about this and shows you the list of permissions you have, and if you can’t access something, the list of permissions you need.
Here’s the list of available permissions for this request.
It goes without saying that you need permissions to grant more permissions to your user.
Final thoughts
With this introduction, you start to understand what Microsoft Graph is and where it shines. It’s an incredible tool from Microsoft that allows you to explore a huge set of services with an even bigger set of endpoints. With this, you’re not limited to any of Microsoft’s products and can integrate information into your own tools and products.
Photo by israel palacio on Unsplash