Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.