What is Microsoft Graph SDK?

This article is a quick overview of MS Graph SDK. Using MS Graph SDK, you can easily write code which calls MS Graph APIs to interact with Office 365 data.

What is MS Graph API?

First, let’s see what MS Graph API is. The official MS documentation defines MS Graph API as:

“You can use the Microsoft Graph API to interact with the data of millions of users in the Microsoft cloud. Use Microsoft Graph to build apps for organizations and consumers that connect to a wealth of resources, relationships, and intelligence, all through a single endpoint: https://graph.microsoft.com”

In a nutshell, MS Graph API gives you a single REST API endpoint which you can call to interact with “almost anything” in Office 365.

To know more about MS Graph API, read my article here.

 What is MS Graph SDK?

Microsoft Graph Software Development Kit is “Microsoft Graph Client Library which allows you to call Office 365, Azure AD and other Microsoft services through a single unified developer experience.”

Using MS Graph SDK, you can quickly integrate MS Graph API in your application, so that you don’t have to write everything to deal with MS Graph API from scratch.

It provides ready-made classes and methods to be used while making Graph API calls. Please note that using MS Graph SDK is not “mandatory” if you want to code your application for MS Graph API. It just makes coding quick and easy.

What’s its availability?

MS Graph SDK is available for most leading development platforms e.g. ASP.Net, Xamarin, Android, iOS, JS, Angular, and many more. Day by day more platforms are being added.

This is the latest availability as of today:

Live availability:

Beta/Preview availability:

No SDK, only code samples available:

Keep watching the official Microsoft page here which mentions MS Graph SDK’s latest availability:

23 SDK

MS Graph SDK for .NET is available as “Microsoft.Graph” and “Microsoft.Graph.Core” NuGet packages:

24 nuget packages

Adding MS Graph SDK to your C# application

Let’s add MS Graph SDK for .NET i.e. MS Graph NuGet packages to a C# application.

Quickly create a new C# application (either console app or web app) in Visual Studio 2015/2017.

Right click project in Solution Explorer and click “Manage NuGet packages”:

10 NuGet

Go to “Browse” and type “Microsoft Graph”, press Enter key:

11 MS Graph package

Select “Microsoft.Graph” package from the result and click “Install” button on right side:

12 MS Graph package 2

It will show you “License Acceptance” dialog:

13 accept license

Note here that it will also install “Microsoft.Graph.Core” package, among others, as one of its dependencies. Click on “I Accept” button.

Output window will show success message once installation is finished.

14 success output

You have successfully added MS Graph SDK packages to your application.

You can make sure that by two ways.

Go to Solution Explorer and select “packages.config” file:

15 packages

See that “Microsoft.Graph” and “Microsoft.Graph.Core” packages are visible in config file:

16 packages file

Also, if you expand “References” in Solution Explorer then you will see Microsoft Graph references:

17 references

You will also need to install “Microsoft.Identity.Client” package as it’s required for authentication code because users are authenticated against Microsoft account.

18 Ms identity

Don’t forget to select “Include prerelease” checkbox!

That’s it! You have now successfully added MS Graph SDK and you are ready to start your coding.

To know how to write code to fetch Office 365 data using MS Graph SDK, read my article “Write your first program using Microsoft Graph SDK” here.

One thought on “What is Microsoft Graph SDK?”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s