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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SeSPowerBi
Frequent Visitor

Power BI REST API ExportTo not working on deployed web app

Solution has been found.

4 REPLIES 4
Anonymous
Not applicable

HI @SeSPowerBi,

Can you please share the solution that you find? I think it may should help others who faced a similar scenario.🙂

Regards,

Xiaoxin Sheng

The ExportTo documentation is for downloading the file on the server side; in the wwwroot virtual directory.

It was working on the local solution since the current directory of the app was inside the user---me drive already C:\Users\username\source\repos\app\...

Once its deployed, the server doesn't have access to the users hard drive 

"Access to the path 'c:\temp' is denied."

 

Since I was strictly following the documentation provided here Export Power BI embedded analytics reports API - Power BI | Microsoft Docs, I forgot to check the logic and confirm.

It was a mistake on my part, as to have access to the client-side directory and functionality, the file needs to be manipulated on the client-side not the server-side.

 

So I had to write code to send the export content as a Blob to then be downloaded on the client side by File-saver.

Anonymous
Not applicable

Hi @SeSPowerBi,

Thank for your sharing, they should help users with similar situations.😊
Regards,
Xiaoxin Sheng

Anonymous
Not applicable

Hi @SeSPowerBi,

>>succeeds with a valid signature in the Bearer token and the response body is null. However, once it executes the Power Bi REST API call ExportTo it has a "404", response not found.

Have you configured your application setting to allow power bi and azure requests? If not, I'd like to suggest you take a look following document about power bi URL lists:

Add Power BI URLs to your allow list 

>>The response is 204, no content. So, the server is sucessfully processed the request but it is not returning any content.

AFAIK, the 'service principal' credential has been limited to used with power bi service rest API. Have you enabled it on the admin portal? In addition, please also take a look at the 'service principal' usage limitations with power bi rest API:

Embed Power BI content with service principal and an application secret#considerations-and-limitatio... 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.