Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

a simple script for creating power bi embedded workspaces and uploading reports in one command

License

Notifications You must be signed in to change notification settings

jsturtevant/power-bi-embedded-workspace-script

Repository files navigation

Power BI Embedded Workspace

A simple script for creating Power BI Embedded Workspaces and uploading reports in one command. It uses Python to combine two command lines tools to achieve creating a workspace collection, creating a workspace, uploading the report, and setting the credentials on the report.

image of tool working

Usage

You have two options:

Python script directly

The python script above assumes you have already installed the following and they are on your path. Skip to docker usage if you don't want to install everything.

After those tools are installed you can run it with the following:

python createworkspacecollection.py -s <azure-subscription-id> -r <azure-resource-group> -w <workspace-collection-name> -l <azure-location> -f <path-to-pbix-file> -n <datasource-name> -u <datasource-username> -p <datasource-password>

Use Docker with tools already installed

You can either pull this repository and build the docker image locally or you can grab a image from my Docker Hub repository.

Navigate to the location of the PowerBi Embedded .pbix file and run the following. This created a volume in docker and links the current directory up in the Docker Container allowing the script to see the .pbix file (below works on windows; Change %CD% to $(pwd) on a mac/linux).

docker run -it --rm -v %CD%:/usr/src/ jsturtevant/power-bi-embedded-workspace-script python createworkspacecollection.py -s <azure-subscription-id> -r <azure-resource-group> -w <workspace-collection-name> -l <azure-location> -f <path-to-pbix-file> -n <datasource-name> -u <datasource-username> -p <datasource-password>

Important notes

  • As of writing there is a bug in PowerBI Embedded CLI on macs and linux. The fix-pbcli-linux shows how to fix on linux and the issue tells you how to fix on mac.
  • Your workspace collection name must be unique across all workspace collection names in Azure.
  • The script currently only uploads one file but could easily be tweaked to upload all reports in a folder.

About

a simple script for creating power bi embedded workspaces and uploading reports in one command

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published