This my first time trying to configure PowerBI REST API and I'm having some problems to connect.
I'm trying to use PowerBIPS. (https://ruiromanoblog.wordpress.com/tag/powerbips/)
- I created an an App at https://dev.powerbi.com/apps 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"
$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 https://api.powerbi.com/v1.0/myorg/groups/50224abf-8c80-4644-88e4-e3f38078245b/reports with 0-byte payload
Invoke-PBIRequest : The remote server returned an error: (401) Unauthorized. - ''
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\188.8.131.52\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: https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal
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.
What's your reasoning for using PowerBIPS ? Would you be willing to run native Powershell instead?
This thread has most fo the details.
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?
Learn how to create your own user groups today!
Click here to read more about the November 2021 Updates!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.