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.
5,909 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2021-03-09T21:13:52.063+00:00
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.