Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Connect PowerBI REST API (PowerBIPS)


This my first time trying to configure PowerBI REST API and I'm having some problems to connect.

I'm trying to use PowerBIPS. (


- I created an an App at as Server-side web application (don't know what configure in url; we use PowerBI Online)

- I got my client_id and secret_id

- I gave all the permissions


When I try to run: 



Install-Module -Name PowerBIPS

$tenantId = "ab96XXXX-XXXX-XXXX-XXXX-XXXXda9ada1"
$clientId = "b3d7XXXX-XXXX-XXXX-XXXX-XXXX160e0f4" 
$clientSecret = "_Jti.XXXX-XXXXfCfG"
#url: http://localhost:1234/resirect.aspx

$authToken = Get-PBIAuthToken -clientId $clientId -clientSecret $clientSecret -tenantId $tenantId

$reports = Get-PBIReport -authToken $authToken -groupId "8e921e7f-50d5-4068-88bc-157a0f1a62ec" -Verbose



I get the error:


VERBOSE: Getting Reports
VERBOSE: GET with 0-byte payload
Invoke-PBIRequest : The remote server returned an error: (401) Unauthorized. - ''
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\\PowerBIPS.psm1:621 char:16
+ ... reports = @(Invoke-PBIRequest -authToken $authToken -method Get -reso ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WebException
    + FullyQualifiedErrorId : System.Net.WebException,Invoke-PBIRequest
VERBOSE: Found 0 reports.


What I'm missing?


I even tried to follow this setps:

But I couldn't do step 4. Shows different.

In workspace members if I search for the App, showes nothing.


I really need your help.

Please, try explain with details, because really don't understand any of this.


Super User
Super User

What's your reasoning for using PowerBIPS ?  Would you be willing to run native Powershell instead?


This thread has most fo the details.

Thanks @lbendlin.

We publish 5-6 reports per week. To do this we have to open pbix file in PowerBI Desktop, in datasource change staging sql server to production sql server, and do the same to login and password. 

I want to automate this. After a search in google found that PowerBIPS allows me to do this.

Do you have any other suggestion to make this?

There are multiple options:


The standard InvokeRestApiCall commands can do the same. 

You can use data source parameters on the service

Deployment Pipelines may be an alternative if you are on Premium. 

Also look into ALMToolkit.

Any examples on how can I use any of this options?


The standard InvokeRestApiCall commands can do the same.


You can use data source parameters on the service


Deployment Pipelines may be an alternative if you are on Premium.


Also look into ALMToolkit.

Helpful resources

PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors