Forum Discussion
Using the API, how to find out which fabric capacity is a workspace part of? so I can resume it
Basically title.
When I fetch https://api.powerbi.com/v1.0/myorg/groups (using an app token with the https://analysis.windows.net/powerbi/api/.default scope) I can see all the workspaces the app has access to. Each workspace has its capacityId on the result.
To resume a fabric capacity, I need to patch to https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Fabric/capacities/{capacityName}?api-version=2023-11-01 (using an app token with the https://management.azure.com//.default scope).
So, how can I link those two results? I mean, how to get the subscriptionId/resourceGroupName/capacityName from the capacityId on the first result?
PS: when I fetch https://api.powerbi.com/v1.0/myorg/capacities (using the same token as the /groups request), the ids of the result does NOT match the ids on the workspaces, so I would guess those are different things?
1 Reply
- collinq
Super User
Hey MuriloMielke ,
I do not see an easy way to do this but I think that PowerShell will let you do this. I did find this site with a sample powershell script that states it will get the capacity for a workspace.
Common Power BI Admin Scripts Part 1 – Insight Quest (insightsquest.com)