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

Paul Hernandez 541 Reputation points
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.

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
13,553 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.
2,851 questions
Microsoft Graph Groups API
Microsoft Graph Groups API
A Microsoft API that creates and manages different types of groups and group functionality.
189 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 20,696 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