Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I'm trying to use the PowerBI Scanner API, according to: https://www.youtube.com/watch?v=mmTklTT73gE
So, I'm able to call "GET-PowerBIWorkspace" and I'm getting workspaces where I have access as a response.
If I try to use the Invoke-PowerBIRestMethod with the Workspace ID as Body, I recieve a Not Authorized Response, which doesn't make sense since I have all needed permissions. Any Ideas?
Used Code:
Login-PowerBIServiceAccount -ServicePrincipal -Credential (Get-Credential) -Tenant ******
GET-PowerBIWorkspace
$body =
'{
"workspaces": [
"****"
]
}'
$url = "https://api.powerbi.com/v1.0/myorg/admin/workspaces/getInfo"
Invoke-PowerBIRestMethod -Url $url -Method Post -Body $body | ConvertFrom-JsonResult:
Invoke-PowerBIRestMethod : Mindestens ein Fehler ist aufgetreten.
In Zeile:16 Zeichen:1
+ Invoke-PowerBIRestMethod -Url $url -Method Post -Body $body | Convert ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException
+ FullyQualifiedErrorId : Mindestens ein Fehler ist aufgetreten.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
Invoke-PowerBIRestMethod : Encountered errors when invoking the command: {
"code": "PowerBINotAuthorizedException",
"pbi.error": {
"code": "PowerBINotAuthorizedException",
"parameters": {},
"details": [],
"exceptionCulprit": 1
}
}
good - fix that issue and then you can continue with the implementation.
Hi thanks, but I didn't find a way to use the Rest Call in the sanbox. Do you know how I can try that?
I can't login with my Service-Principal on that, only with my personal account and that one doesn't have enough rights.
does it work in the REST API sandbox?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 55 | |
| 50 | |
| 43 | |
| 16 | |
| 15 |