Showing results for 
Search instead for 
Did you mean: 
Not applicable

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.

Not applicable

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.

Not applicable

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

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.