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!
It seems from this that there is an a Capacity Assignment permission. It also specifies to use the service principal object ID: Move your Power BI embedded analytics app to production - Power BI | Microsoft Learn
Assign a workspace to a capacity by using a service principal
To assign a workspace to a capacity by using a service principal, use the Power BI REST API. When you're using the Power BI REST APIs, make sure to use the service principal object ID. The service principal should have administrator permissions for the workspace and capacity assignment permissions for the capacity.
Anonymous
Hi Greg_Deckler
Thanks for your reply. I am using REST API to create workspace and assign capacities. As you have mentioned I have already added the service principal to my workspace (as admin). Regarding the service principal having permissions to assign capacity or not, how can I check this ? Where can I assign this permission ?
Thanks
- Greg_Deckler2 years ago
Community Champion
Anonymous These are the instructions found here: Manage your Fabric capacity - Microsoft Fabric | Microsoft Learn
To add or remove admins in a Fabric capacity, follow these steps:
-
In the Capacity settings page, select Fabric Capacity.
-
From the list of capacities, select the capacity you want to make changes to.
-
In the capacity's setting page, from the Details tab, select expand Admin permissions.
-
Add or remove admins from the text box.
-
Select Apply.
To add or remove admins in a Power BI Premium capacity, follow these steps:
-
In the Capacity settings page, select Power BI Premium.
-
From the list of capacities, select the capacity you want to make changes to.
-
In the capacity's setting page, from the Details tab, select expand Admin permissions.
-
Add or remove admins from the text box.
-
Select Apply.
- Anonymous2 years agoNot applicable
Greg_Deckler Hi,
We have PowerBi Premium Capacity and I tried to add, but i'm unable to add a ServicePrinciple or a Security Group in there. looks like it works only for individual users. Do you know how to add a ServicePrinciple ?
Thanks in advance.
- Anonymous2 years agoNot applicable
Thanks for the reply from Greg_Deckler , please allow me to provide another insight:
Hi, Anonymous
Regarding adding a service principal to a workspace, my solution is as follows:
First, if you're an administrator, check that your following switches are on:
Second, add normally:
You can also use PowerShell to add it, here's a screenshot of the official documentation for the content:
Here is the relevant documentation:
Embed Power BI content in an embedded analytics application with service principal and an application secret - Power BI | Microsoft Learn
Automate Power BI Premium workspace and semantic model tasks with service principals - Power BI | Microsoft Learn
Of course, 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.
-