I'm trying to create script that will refresh some datasets through Power BI API. I have registered App in Active Directory and gave it almost every permissions possible for Power BI Service (only missing ones are "Read and write all content in tenant" and "View all content in tenant"). I am the owner of the refreshed dataset and admin of Data Gateway it accesses.
If I put in my script cmdlet:
$urlrefresh = "groups/$groupID/datasets/$datasetID/refreshes"
Invoke-PowerBIRestMethod -Url $urlrefresh –Method GET
everything is working and script will retrieve list of refreshes, but if I'm trying to do the same with -Method POST, script fails on some kind of write error.
I'm assuming it must be some kind of permissions problem, but like I said, App is already having almost all of them.
Invoke-PowerBIRestMethod : One or more errors occurred.
At line:2 char:1
+ Invoke-PowerBIRestMethod -Url $urlrefresh -Method Post –Verbose
+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException
+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
thanks for your reply. App is registered in AD with all permissions possible. Is there something different (perhaps on tetant level) that can override them?
I would suggest making sure at the top where it says"Application Permissions you got that set to what is shown below.