Forum Discussion
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
- AnonymousNot applicable
Hi Anonymous ,
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
Best Regards
- AnonymousNot applicable
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.- AnonymousNot applicable
Hi Anonymous ,
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