Microsoft Graph is like a gateway to the data and insights in Office 365. This exposes APIs and libraries to access data from Office 365 services, Azure active directories, etc. It connects all the services available using relationships on which we can get valuable insight into the data from the Microsoft Graph API. Microsoft Graph is a RESTful web API that enables you to access Microsoft Cloud service resources. After you register your app and get authentication tokens for a user or service, you can make requests to the Microsoft Graph API. In this blog, we will feature briefly on how we can connect to Graph API and fetch Office 365 Users list from Azure Data Factory using examples.

Building a pipeline to fetch O365 Users

1) Create a new pipeline and drag a web activity which will fetch us the access token to get authorized to hit the graph API.
2) Configure the web activity by providing the following details:

  • URL
  • Method
  • Headers
  • Body

fetching-office-365-users-using-graph-api

 

3. Drag a copy activity and configure the source and sink datasets with necessary parameters. Source dataset will be a REST API which will have one parameter for holding the access token.
fetching-office-365-users-using-graph-api

4. Mention the expression for parameter which will hold the access token generated by the web activity.
fetching-office-365-users-using-graph-api

Sink dataset will be AzureDataLake file (here we are having JSON formatted file as a sink)fetching-office-365-users-using-graph-api

5. Validate and trigger the pipeline.

Following the above steps, your pipeline looks like the one in the below image.
fetching-office-365-users-using-graph-api

 

fetching-office-365-users-using-graph-api

The output file will look like below
fetching-office-365-users-using-graph-api

Thus, we have a list of Office 365 users and their details in the Users.json file fetched from graph API using Azure Data Factory.

Read more blogs on Microsoft click here to know more on Visual BI Solutions Self Service offerings click here.

Subscribe to our Newsletter

5920 Windhaven Pkwy
Plano TX 75093.

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com