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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.