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

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

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

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.

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

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

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.