a simple script for creating power bi embedded workspaces and uploading reports in one command
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.
You have two options:
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>
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>