I m working on a small task where I have to fetch gateway detail of the PowerBi Datasets using an API. We are using PowerShell scripts to fetch the data.
I m able to access the Datasets and Other details but when I modify the script to access the Gateway details I m getting the following error
- … $gatewaydata = Invoke-PowerBIRestMethod -Url $gatewayuri -Method Get
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : WriteError: (Microsoft.Power…werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], Exception
FullyQualifiedErrorId : Encountered errors when invoking the command: {
“code”: “PowerBINotAuthorizedException”,
“pbi.error”: {
“code”: “PowerBINotAuthorizedException”,
“parameters”: {},
“details”: [],
“exceptionCulprit”: 1
}
},Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
When I checked the App registration for the API I can see that PowerBi API has the access related to gateway enabled.
How to resolve this issue?
Thanks in advance.
I had given all the app related details like appId, appsecret and executed it. I was expecting the gateway details but got error saying “PowerBINotAuthorizedException”
dhanush selvanayagan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.