I am working on a scenario where I need to fetch the list of users having admin access (Global Administrator) permission on Azure AD and send them an email.
However, when I started working on it I could not find any action in logic app designer which could help me retrieve list of Admin users.
I tried using Azure AD connector with GetUser action but it didn’t fulfilled my request as it only fetches some basic properties of user like businessPhones, displayName, givenName, id, jobTitle, mail, etc.
Can anyone please guide me how can I retrieve list of Admin users present in my Azure AD?
2
Answers
Unfortunately, there is no connector in Logic Apps of Azure AD available to get list of users with Admin Access.
The only available actions are:
And
You can use the graph API and make a direct call using the HTTP request operation.
https://learn.microsoft.com/en-us/graph/api/directoryrole-list-members?view=graph-rest-1.0&tabs=http
You’ll need to register an application in Azure AD and assignment it the appropriate rights. From there you need to supply the application ID and secret to get have it authenticate successfully for you.
Result
You’ll get a list of users that have been assigned. My tenant only has myself but it gives you an idea.