Forum Discussion
Power Bi REST API - 401 Authorization error when using app secret
- 7 years ago
Hi tripleacoder,
As far as I know, the permissions of Power BI are all based on the users. So an App can't act as a user. Please refer to developer/power-bi-permissions where all the descriptions have "user".
Regarding "Tenant.ReadWrite.All", the documentation above also has a description. Actually, these permissions only can retrieve the profiles rather than data. Please refer to admin/reports_getreportsasadmin.
One simple proof we can see is that even an admin can't access all the App workspaces. The data is the precious asset of a company. I think this is reasonable.
Best Regards,
Dale
Anyone got this worked out? I'm running into the same issue where we need to assign workspaces to a capacity via this POST Call
Invoke-PowerBIRestMethod -Url 'admin/capacities/AssignWorkspaces' -Method Post -body $bodyStrThis works for my ID but fails for ServicePrincipal. Is the ServicePrincipal only allowed for "Read-Only" API calls (GET method)?
Please let me know as we're trying to automate some scripts using ServicePrincipal/App ID. Not sure what we're missing.
- Anonymous2 years agoNot applicable
Hi, did you solve it, appreciate for your response, thanks!
- pvuppala2 years ago
Helper V
Ended up using personal account to run the PowerShell script. Eventually would like to use Power Automate via Service Principal client/secret.