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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Frankfh
New Member

Export to file api - Forbidden

There seems to be some issues with the ExportToFileInGroupAsync. I have followed the documentation provided on the docs pages, and verified that all steps are OK.

 

I'm running the code with service principal, and the service principal has been added to an AD group which has Administrator access to the workspace where the report I want to generate exist.

 

Code:
var export = await pbiClient.Reports.ExportToFileInGroupAsync(groupId, reportId, exportRequest);

Error code:
Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'Forbidden'

To validate that I actually have access to the PowerBI service I have tried to run var reports = await pbiClient.Reports.GetReportsInGroupAsync(groupId); and verified that I can retrieve a list of the reports I try to access. This works fine without any issues.

 

Please provide some guidance on this.

3 REPLIES 3
Anonymous
Not applicable

Hi @Frankfh ,

Premium Per User (PPU) is not supported. Please refer the content in the following links, hope they can help you resolve the problem.

Invalid Status Code Forbidden after client.Dashboards.GenerateTokenInGroupAsync

PowerBIClient Forbidden issue

Best Regards

I'm using a service principal so no license involved. Shouldn't this API be available on a developer capacity aswell?


The docs says to use either a master user or a service principal to authenticate.

Anonymous
Not applicable

Hi @Frankfh ,

Please check whether it hit any of following limitations:

  • The report you're exporting must reside on a Premium or Embedded capacity.
  • The dataset of the report you're exporting must reside on a Premium or Embedded capacity.
  • For public preview, the number of Power BI exports per hour is limited to 50 per capacity. An export refers to exporting a single visual or a report page with or without bookmarks, and doesn't include exporting paginated reports.
  • Exported reports cannot exceed a file size of 250 MB.
  • When exporting to .png, sensitivity labels are not supported.
  • The number of exports (single visuals or report pages) that can be included in an exported report is 50 (this doesn't include exporting paginated reports). If the request includes more exports, the API returns an error and the export job is canceled.
  • Personal bookmarks and persistent filters are not supported.
  • The Power BI visuals listed below are not supported. When a report containing these visuals is exported, the parts of the report that contain these visuals will not render, and will display an error symbol.
    • Uncertified Power BI visuals
    • R visuals
    • PowerApps
    • Python visuals
    • Visio

Best Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.