0

We have lot of references in the web to fetch the all AAD users but i need to fetch all the users from an Azure subscription.

I have created an App in Azure active directory and added that App to the Subscription then used ClinetId and Client secret to create the AuthToken. Used the created auth token to hit the below REST API(an Azure resource management REST API)

https://management.azure.com/subscriptions/{my subscription id}/resourceGroups/{My resource group name}/providers/Microsoft.ApiManagement/service/{my Azure managment API Name}/users?api-version=2018-01-01

But this rest API is retrieving only one User, which is mine.

Here i want to retrieve all the users in a subscription.

Here is the MSDN url i used as reference.

Please can any one help me on this.

Avinash
  • 2,053
  • 2
  • 14
  • 32
  • I am unsure is this issue is because i am using the Free Subscription.. Please can any one help me on this – Avinash Jun 30 '18 at 03:09
  • Hi, Below URL is fetching the list of Users in a Subscription. https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-rest But this URL is fetching only User GUID. But i want all the information of a User. Please can any one help me in getting all the information of all the users. – Avinash Jul 02 '18 at 07:22
  • You can find the answer for this question in below thread. https://stackoverflow.com/questions/51093012/removing-the-user-from-azure-subscription-programticallyc/51199620#51199620 – Avinash Jul 05 '18 at 20:51

2 Answers2

0

It is not because of the free sub.

Does your app have the permission to the Graph API (to read users)? If you try the same user via PS console and you get the same output then its not your code but permissions (Good read on PS https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-powershell-1.0/ff730967(v=technet.10) ).

On the graph api here https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-graph-api-quickstart

Stefan Georgiev
  • 119
  • 2
  • 4
  • Thanks for the reply Stefan. Example URL you have given is using Graph API, If I don't understand wrong Graph API will fetch all the users from Azure active directory(not from Subscription). Correct me if i am wrong. Here i want to retrieve all the users from an azure subscription. I was looking for solution from few days, please can any one help me here. – Avinash Jun 30 '18 at 18:12
  • Please let me know if we can get the users from Subscription also from Graph API. – Avinash Jun 30 '18 at 18:13
  • Hi, Below URL is fetching the list of Users in a Subscription. https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-rest But this URL is fetching only User GUID. But i want all the information of a User. Please can any one help me in getting all the information of all the users. – Avinash Jul 02 '18 at 07:23
0

You can find the answer for this question in below thread.

Removing the user from Azure subscription programtically(C#)

Avinash
  • 2,053
  • 2
  • 14
  • 32