Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi All,
I am facing issue while calling REST API through REST connector in Fabric using Service Principal Authentication. Where to pass this accessToken ?
Hi @AmanShaikh ,
Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!
Best Regards
Yilong Zhou
Hi @Anonymous
I was trying to get data from API, but now I am using other solution to get data from the source. So I didn't try this.
Thanks
Hi @AmanShaikh ,
I'm glad you found another way to solve your problem, could you please share your method?
If you can, I'm sure it can help other users on the forum!
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AmanShaikh ,
It looks like you are experiencing issues with the accessToken parameter not being passed correctly when calling the REST API through the REST connector in the fabric using service principal authentication, the accessToken on the screenshot is currently null.
I think the first thing you can do is to generate it using a tool like Postman or programmatically in code, you can try the following Postman code for generating the token.
POST https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
client_id={your-client-id}
client_secret={your-client-secret}
scope=https://api.fabric.microsoft.com/.default
Once you have the access token, you need to include it in the headers of your REST API request. Typically, this is done by adding an Authorization header with the value Bearer {accessToken}.
Also you need to make sure that the service principal has the necessary permissions to access the Fabric APIs. This includes adding the service principal to the Fabric workspaces with at least a Contributor role.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |