Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a user, with whom I can assign a capacity on app.powerbi.com/group/id in settings -> premium.
I also have an azure app with all delegated permissions (embed for customer scenario).
I programatically clone the workspace, refresh dataset and the last step should be assigning a capacity for the workspace.
https://api.powerbi.com/v1.0/myorg/capacities returns
{
id": "some id",
displayName": "Premium Per User - Reserved",
admins": [],
sku": "PP3",
state": "Active",
capacityUserAccessRight": "Assign",
region": "North Europe",
users": []
}
But when I use the returned capacity id in body request for this endpoint:
https://api.powerbi.com/v1.0/myorg/groups/my-workspace-id/AssignToCapacity, I get 401 Unauthorized.
What can be the issue here? Running out of ideas
I had the same issue with a Microsoft Fabric capacity in Azure.
The account that calls the API must be configured as Capacity Adminstrator in the resource's settings. RBAC roles are not sufficient in this case.
I have a similar problem. I am using ServicePrincipal in my API. I am able to successfully create a new workspace, add admin users, create/clone datasets/reports. But I cant seem to assign the workspace to a embedded capacity. I get the below exception
Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'Unauthorized'
Is this is known issue. Please respond if anyone has a solution to this problem. My entire POC rests in a successful creation of workspace through API without any manual interaction
Menita
The problem persists, any ideas?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |