Reading up on the PowerBI API to import PBIX files to the PowerBI service and an example on the actual request I decided to write a PowerShell function to import a PowerBI PBIX file to the PowerBI service.
The PowerBI Import API is quite specific and kept giving me 400’s like:
- “Bad Request” with no details
- UnknownError pbi.error exceptionCulprit 1 (loved this one)
Eventually I figured out how to import my reports directly into PowerBI, so to help you automate importing your reports into workspaces or directly to customers using PowerShell, I’ll share my PowerShell function with you: