Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Grasmachien
Frequent Visitor

Export paginated report to file forbidden

Hi,

I'm trying to use the "exportToFile" API.
However I keep getting back a status 403.

I'm embedding a report in a website using the. powerbi-client package.
We are using an app registration in Azure in order to authenticate with the service.
This means that all visitors of the embedded report will be using the same access token.

I have configured the needed permissions in Azure but I assume that this is not used since the exportToFile API makes a call directly to api.powerbi.com
Do we need to set some permissions in PowerBi itself as well or is it possibe to configure this with Azure?

1 ACCEPTED SOLUTION

When ever you call a Power BI API you need to send an authorization header with a token. It's not specific for this API.

Otherwise Power BI cannot know who's sending the request, and validate the permissions.

View solution in original post

3 REPLIES 3
AmosHersch
Microsoft Employee
Microsoft Employee

H,

 

Are you saying that you're able to embed the report with your Service Principal? If so, then it means you've added the service principal to the report's workspace in Power BI, or otherwise the call to generate the embed token should've failed.

 

In that case the same Service Principal should be able to call the "Export to File" API (same AAD bearer token).

Hi @AmosHersch,

 

I'm a developer and I have no idea how Power BI works.
I assume you are right about the Service Principal.

So if I understand correct I should be able to add an Authorization header to the call with the same access token in order to get the permissions to export?

 

Is there any documentation about this?

There does not seem to be anything on this in the docs: https://learn.microsoft.com/en-us/power-bi/developer/embedded/export-paginated-report

 

When ever you call a Power BI API you need to send an authorization header with a token. It's not specific for this API.

Otherwise Power BI cannot know who's sending the request, and validate the permissions.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.