1
votes

As Azure REST APIs helps to retrieve the users and corresponding roles information at subscription level.

I would like to know that I have manually created a few users and assigned them different roles in Azure Active directory and i want to access those information from azure active directory through REST API calls or in a programmatic way.

How can I access that information at azure active directory level to retrieve the user list ? is there any API calls available ? what about GRAPH API on this scenario and how it can be used ?

Please input your suggestions. Thanks All !

3

3 Answers

0
votes

Yes, you can do this via the REST API.

There are two APIs available:

  1. Azure Active Directory Graph API - graph.windows.net (old)
  2. Microsoft Graph graph.microsoft.com (new).

You should go with the new graph.microsoft.com API (check whether the new API covers all your requirements).

See Working with users in Microsoft Graph

0
votes

You can use Microsoft Graph to list all users: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list

https://graph.microsoft.com/v1.0/users/

You can give it a try with the Graph Explorer at https://developer.microsoft.com/en-us/graph/graph-explorer

You will need an access token to call Microsoft Graph, more information about obtaining an access token can be found here: https://developer.microsoft.com/en-us/graph/docs/concepts/auth_overview

0
votes

You could use the Azure AD Graph API to retrieve users list and corresponding roles by using GET https://graph.windows.net/myorganization/users?api-version=1.6. For the details, please read here.