We are happy to announce the general availability of Azure Active Directory (AAD) Graph Client Library 1.0. The goal of this library is to simplify .NET developer experience to write an application that leverages Azure AD through Graph API. The library supports all the capabilities exposed by the Graph API version 2013-11-08 and it is available as a NuGet package at https://www.nuget.org/packages/Microsoft.Azure.ActiveDirectory.GraphClient/1.0.2
To install Graph Client, run the following command in the Package Manager Console
PM> Install-Package Microsoft.Azure.ActiveDirectory.GraphClient
Consuming the Graph API directly (using raw web requests) can be tedious and error prone and also preparing the request for some advanced queries is non-trivial. Another popular option to consume OData services is to use Microsoft.Data.Services.Client (WCF Data Services) which could add unnecessary complexity to the application logic. Azure Graph client library provides a simple way to access Graph and it is the recommended way to access Azure AD.
The library contains definitions for all the Graph entities available along with all their properties. All the client library functions are exposed through the GraphConnection class. To initialize a new connection, you need to provide an access token, which can be obtained using Azure Authentication Library.
GraphConnection graphConnection = new GraphConnection(accessToken);
There are several operations available on GraphConnection for various operations including,
Most APIs has overloads to meet different requirements and GraphConnection can be extended to add custom behavior or override specific methods. The sources are available at <Temporarily Removed>, please fork and contribute. We welcome your pull requests.
The following are our priorities in relation to the next official releases of the library. We welcome any feedback.
The console application - https://github.com/AzureADSamples/ConsoleApp-GraphAPI-DotNet and a web application - https://github.com/AzureADSamples/WebApp-GraphAPI-DotNet shows how to use this library.
In part 2 of this blog, we will talk in detail about each of the APIs with a complete API reference.
Pavan KompelliVijay SrirangamEdward Wu
Azure Active Directory Team