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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Kudoed Authors