Amanjeet_Singh's avatar
Amanjeet_Singh
New Member
8 years ago
Status:
Completed

PowerShell: Export and import Power BI reports and Workspaces

Currently, PowerShell has modules for exporting Power BI reports. It would be good to have new feature in PowerShell, so that one can export and import workspaces along with all the Power BI reports that belong to it programmatically.

4 Comments

  • It's already possible to do this using only existing PowerShell scripting techniques and pre-built Cmdlets from the MicrosoftPowerBIMgmt module. No API calls necessary. Backup: Use the Get-PowerBIWorkspace and Get-PowerBIReport Cmdlets to pull the lists of everything you need to back up, save your Workspace names (I recommend using file folders on your hard drive to represent the Workspaces you're backing up, and you can save a JSON file in each Workspace folder containing that Workspace's metadata if you need it), then use the Export-PowerBIReport Cmdlet to download the Reports. If you use my recommended file folder method, it makes storing and retrieving any given exported Report much easier, because you can just drop it into the folder whose name matches the Workspace it came from. Restore: Use the New-PowerBIWorkspace Cmdlet to create the new Workspaces, enumerate through them with Get-PowerBIWorkspace to match the new WorkspaceId GUIDs with their original names (you'll probably want to create a PS hashtable variable to store that lookup table in memory, so you don't have to re-run the Get-PowerBIWorkspace Cmdlet for each Workspace you restore), and then use the New-PowerBIReport Cmdlet to upload each Report to its respective Workspace.
  • First comment - "It's already possible to do this using only existing PowerShell scripting techniques and pre-built Cmdlets from the MicrosoftPowerBIMgmt module. No API calls necessary."

Recent ideas