List all AD Users using Azure Function

Jayesh Nathani 21 Reputation points
2021-03-09T09:17:45.063+00:00

Hello,

I am trying to get the list of all active directory users, but I am stuck.

I am using Logic App to trigger my Azure Function and my Azure Function has Managed Identity setup. So I am able to retrieve a token, but when I pass this token to:

GET https://graph.microsoft.com/v1.0/users
Authorization: Bearer {{token}}

then I'm getting the below error:

{
"error": {
"code": "InvalidAuthenticationToken",
"message": "Access token validation failure. Invalid audience.",
"innerError": {
"date": "2021-03-09T08:41:51",
"request-id": "e55aa5b0-c179-4e3c-ad0f-87b5c874cd58",
"client-request-id": "e55aa5b0-c179-4e3c-ad0f-87b5c874cd58"
}
}
}

How do I add the audience for the graph API?? Please help

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,299 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,854 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,566 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful