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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
aaldo_666
Helper I
Helper I

Download PBIX file using service principal

Hi, 

I set up service principal and I can use it to list specific report, but Im not able to download that PBIX file.

The error I get is Export-PowerBIReport : Operation returned an invalid status code 'Forbidden'

Now I dont know if Im missing priviledges or if service principal can be used for that.

Is it possible to use service principal to download PBIX file from services? 

PS:
I cannot use service principal to download PBIX, how can I download automatically PBIX from services where is 2FA authorization implemented. 

Thanks.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @aaldo_666 ,

 

Do you use the Reset API or click the download pbix option on the service?

Based on the error message, it appears to be an error caused by insufficient permissions. Please check the restrictions on downloading PBIX files according to the following documents.

Export Power BI embedded analytics reports API - Power BI | Microsoft Learn

Download a report from the Power BI service to Power BI Desktop - Power BI | Microsoft Learn

 

Also, pay attention to report with a sensitivity label can't be exported to a .pdf or a .pptx using a service principal.

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @aaldo_666 ,

 

Do you use the Reset API or click the download pbix option on the service?

Based on the error message, it appears to be an error caused by insufficient permissions. Please check the restrictions on downloading PBIX files according to the following documents.

Export Power BI embedded analytics reports API - Power BI | Microsoft Learn

Download a report from the Power BI service to Power BI Desktop - Power BI | Microsoft Learn

 

Also, pay attention to report with a sensitivity label can't be exported to a .pdf or a .pptx using a service principal.

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Thank for response. I forgot to put some details. I have Premium per user license and I want to download PBIX file in format of .pbix using powershell Export-PowerBIReport commandlet.
As I read in the link you sent  

  • Exporting a Power BI report to file using the exportToFile API, isn't supported for Premium Per User (PPU).

So I have to wait for premium per capacity license.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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

Top Solution Authors