Forum Discussion
Error assigning premium capacity to workspace - PowerBINotAuthorizedException
- Anonymous2 years ago
Greg_Deckler Anonymous : Thank you all for the response. I have successfully resolved the issue by ensuring that the premium capacity had the necessary contributor permissions. After doing so, my Python code was able to assign the capacity. I would like to express my thank you to you both.
Screenshot attached here :
To assign the necessary permissions, go to Power BI Admin, navigate to Capacity, and select the Premium Capacity and then go to the Contributor option. In this step, make sure to specify the correct security group name, as we had security groups in place..
In the future, if anyone works with a Service Principal Admin, I would recommend considering this parameter as well.
Thank you!
Anonymous : Thank you for the reply.
I had added service principal as admin to the workspace, and from what you mentioned above I have also enabled settings in the PowerBI Admin portal.
However when I try to run this API call, I get this error -
"pbi.error":{"code":"PowerBINotAuthorizedException","parameters":{},"details":[],"exceptionCulprit":1}
What am I missing ?
HI,Anonymous
Thanks for the quick reply.
Has the problem been solved? If it does, share your solution and accept it as a solution that will help other community members who have the same problem as you.
In response to your question, based on the information I've gathered, you can try the following:
1.First, you can try adding the service principal to the security group and then perform a similar operation on the security group to see if that solves the problem.
Here are screenshots and links to the relevant answers:
2.Second, you can try removing the permissions granted.
The access token is then decoded using a JWT token decoder to check for the presence of a key/value pair.
3.Finally, if the token still contains the value of the key/value pair, create a new app that doesn't have permissions and add it to an existing security group.
Here are screenshots and links to the relevant answers:
python - Power BI Rest API Requests Not Authorizing as expected - Stack Overflow
Of course, hopefully you will back up your important data before trying my advice to see if that solves the problem.
If you have any new ideas, you are welcome to contact us.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.