Accesing Graph API from Synapse Workspce using the workspace managed identity.

Paul Hernandez 651 Reputation points Microsoft Employee
2022-02-07T15:16:37.057+00:00

Hi everyone ,

I am trying to access the Graph API from a Synapse Workspace Pipeline using the managed identity of the workspace but I still miss some pieces.

We have an AAD group with "Directory Reader" role assigned and we added the MI of the workspace to this group.

Now I'm using a Web Activity to call the Graph API as follows:

171991-image.png

I got the following error:

{

"errorCode": "2108",  
"message": "{\"error\":{\"code\":\"InvalidAuthenticationToken\",\"message\":\"Access token validation failure. Invalid audience.\",\"innerError\":{\"date\":\"2022-02-07T15:08:06\",\"request-id\":\"7ce4d1ab-d378-48d8-aa3d-d39a658f68c2\",\"client-request-id\":\"7ce4d1ab-d378-48d8-aa3d-d39a658f68c2\"}}}",  
"failureType": "UserError",  
"target": "Get Users",  
"details": []  

}

I think I don't need any token since I'm using the MI, but I don't know exactly what's wrong, whether I am still missing permissions or I need a token anyway.

Any comment will be appreciated.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,007 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,916 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,717 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 41,941 Reputation points
    2022-02-08T09:28:11.467+00:00

    Hi @Paul Hernandez

    You just need to change the Resource to: https://graph.microsoft.com/.

    172231-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

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.