项目作者: jsturtevant

项目描述 :
a simple script for creating power bi embedded workspaces and uploading reports in one command
高级语言: Python
项目地址: git://github.com/jsturtevant/power-bi-embedded-workspace-script.git
创建时间: 2017-02-07T16:33:25Z
项目社区:https://github.com/jsturtevant/power-bi-embedded-workspace-script

开源协议:MIT License

下载


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:

  1. 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).

  1. 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.