Forum Discussion
PowerBI Export RestAPI failing for 500MB file
Hi Ahmed,
Thanks a lot for your feedback and recomendations. I have the below observations after running these codes:
1. When hitting the ExportTo restAPI, power bi server returned back with a failure that PBIX is not the correct format type to download in. I checked hte documentation and it said use only PPTX, XLSX, etc and not to use PBIX
2. The second approach seems to over come the time out but it takes an anormous time to start a download and the download takes several 10s of minutes. This approach also does not seem to be stable as I hit the API URL, if I get a 307 I hit the redirect URL and if this returns a 200 or 202 in about 3-4 minutes, I start receiving the data which takes several minutes. Otherwise it fails, and I hit the initial API again and guide to the redirect url.
3. The powershell option also seems to be failing when run directly as a pwoershell script or through python. We are getting a 403 error in this process.
Any idea how we can fix this for a python script. At this point it feels we are chaising our tails because every solution results in a similar issue if not the same one.
Again thanks a ton for replying back on this question.
Hi BhumitraSharma,
So Lets try another Approch Using Azure AD app (It should work)
- For not wasting your time there is a video that shows the first 1 to 5 Steps or this Video you should watch it Then Make sure your Service Principal:
It has API permissions for Power BI Like (Report.Read.All and Workspace.Read.All)
Admin consent has been granted
In Power BI Admin Portal → Tenant Settings (the Service Principal feature is enabled)
The Service Principal is added to the workspace containing your large PBIX as Member or Admin
If possible make sure the workspace is Premium this avoids 4 minute timeout issues
Also Before trying the download
- Test workspace access:
curl -X GET https://api.powerbi.com/v1.0/myorg/groups \
-H "Authorization: Bearer <ACCESS_TOKEN>"- Test report access:
curl -X GET https://api.powerbi.com/v1.0/myorg/groups/<WORKSPACE_ID>/reports/<REPORT_ID> \
-H "Authorization: Bearer <ACCESS_TOKEN>"Should return 200 OK
Also Make sure you are using the correct API
- DO NOT use ExportTo for PBIX (only supports PPTX/PDF/XLSX)
Use the synchronous Export API:
GET https://api.powerbi.com/v1.0/myorg/groups/<WORKSPACE_ID>/reports/<REPORT_ID>/Export?format=PBIX&preferClientRouting=true- Ensure to before running 500 MB files test your workflow with 50 or 100 MB PBIX
Final Tip:
- I am not an Azure hero or Specialist in it So you can go to Azure Community and ask a question like I want to export Large PBIX File using Azure AD app they will be more helpful than me