Power BI command line interface for managing Power BI Embedded workspace collections
Install from npm
npm install powerbi-cli -g
The following global flags are available to all commands. These can be stored with the config
command
-c --collection
The Power BI workspace collection name
-w --workspace
The Power BI workspace
-k --accessKey
The Power BI access key. This key can be acquired from your Power BI workspace collection within your azure subscription
-b --baseUri
The base URI that will be used to call the Power BI REST apis. The default value is https://api.powerbi.com.
-r --reportId
The Power BI report id
-h --help
Displays command line help
Display root level help
powerbi -h
Display command specific help
powerbi <command> -h
Gets and sets configuration values that are reused in commands. Config values are stored within a .powerbirc
file. If you store access keys please ensure that you do not commit these values to any public source control. If your access keys are compromised a user can take full control over your Power BI workspace collection. If you feel your account was compromised you can regenerate your access keys in the azure portal.
Setting new configuration values
powerbi config -c <collection> -k <accessKey>
Getting a list of all configured values
powerbi config
Gets a list of all workspaces within a workspace collection
powerbi get-workspaces -c <collection> -k <accessKey>
Creates a new workspaced within a workspace collection
powerbi create-workspace -c <collection> -k <accessKey>
Gets a list of all datasets within a workspace
powerbi get-datasets -c <collection> -w <workspaceId> -k <accessKey>
Deletes a dataset and any underlying linked reports
powerbi delete-dataset -c <collection> -w <workspaceId> -k <accessKey> -d <datasetId>
Gets a list of all reports within a workspace
powerbi get-reports -c <collection> -w <workspaceId> -k <accessKey>
Imports a PBIX file into a
powerbi import -c <collection> -w <workspaceId> -k <accessKey> -f <file> -n [name] -o [overwrite]
Updates connection strings and/or credentials for an existing dataset
powerbi update-connection -c <collection> -w <workspaceId> -k <accessKey> -d <datasetId> -s [connectionString] -u [username] -p [password]
Creates a Power BI app token
powerbi create-token -t <tokenType> -c <collection> -k <accessKey> -w <workspaceId> -r <reportId> -u [username] --roles [roles1,roles2,...]