This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. 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.
Check out the April 2026 Fabric update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 2 |