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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
aaldo_666
Frequent Visitor

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
v-tangjie-msft
Community Support
Community Support

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
v-tangjie-msft
Community Support
Community Support

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors