Problem
I created a Microsoft Fabric capacity in Azure and assigned it to a workspace. I understand that if the capacity is paused, this will save me on cost since the capacity is billed for the duration it is running. However, it’s not feasible to manually start or pause this capacity manually each time. Is there a way to automate this?
Solution
For an introduction to Microsoft Fabric and its capacities, check out the following tips:
Unfortunately, at the time of writing, there are no dedicated Microsoft Fabric REST API endpoints to help us with this automation job. There is a Power BI REST API for capacities, but it’s unrelated to Fabric capacities (at least not the Azure F-SKU you can pause/resume). Luckily, we still have the REST APIs of Azure itself. This tip will show how to use the Azure REST API to start a paused capacity. Hopefully, a dedicated Microsoft Fabric REST API will be available in the future.
We’ll use Azure Data Factory (ADF) as the tool of choice to start the Fabric capacity. You can also use other services, such as Azure Functions or Azure Logic Apps, but the principles remain the same. You could also use a Fabric data pipeline (which is similar to using ADF). The problem is that you cannot use a Fabric pipeline to start a capacity if the pipeline belongs to a workspace with the same capacity assigned. This would mean you would need multiple capacities, where there’s one capacity used to start/pause the other capacities. Having such a capacity continuously running comes with a cost. It’s much cheaper to use ADF or any other services, but as a downside, not everything will be centralized in Microsoft Fabric.
Resume a Capacity with the Azure REST API
For an introduction to ADF, check out this tutorial. Create a new pipeline and add a Web activity to the canvas. Next, add three parameters to the pipeline:
- Subscription – This is the guide to the subscription hosting the capacity.
- Resourcegroup – This is the name of the resource group that contains the capacity.
- Capacity – This is the name of the capacity.
Having these values parameterized will be helpful if you want to pause/resume multiple capacities (and you want your pipeline being called from a For Each loop) or if you are deploying the pipeline from one environment to another.

As a first step, we will check the pipeline to see if the capacity is already running.

We can do this by calling the Microsoft.Fabric/capacities endpoint. For the URL property, configure the following expression:
https://management.azure.com/subscriptions/@{pipeline().parameters.subscription}/resourceGroups/@{pipeline().parameters.resourcegroup}/providers/Microsoft.Fabric/capacities/@{pipeline().parameters.capacity}?api-version=2022-07-01-preview
Make sure there are no typos in the URL. This can result in unexpected errors. For example, I made a small mistake in the API version, and the following error was returned:

The Web activity will use the GET HTTP method to retrieve the capacity status. As for the authentication, it’s easiest to use the system-assigned management identity of the ADF instance. As the resource, we need to use https://management.azure.com. The Web activity has the following configuration:

To start or pause a capacity, contributor permissions are required on the capacity level. In the Azure portal, go to the capacity and then Access Control (IAM). Assign the ADF managed identity to the contributor role.

If the needed permissions are missing, the following error is returned:

For the moment, it’s not possible to add this specific action to a custom role, so the contributor role is the bare minimum.
When we debug the pipeline, the following output will be returned by the Web activity:

The state property is the one we need. In the screenshot, the value is Active, which means the capacity is running. A state of Paused is returned when the capacity is not running. Other information is also returned, such as the capacity admin, the location, and the current SKU of the capacity.
Let’s add an If condition to the canvas and connect it to the Web activity. We will use this condition to check if the capacity is running or not based on the output of the Web activity. You can use the following expression:
@equals(activity('Get Capacity Info').output.properties.state,'Paused')
If the expression returns true, the capacity is paused and needs to be started. In the True section of the condition, add another Web activity. This time we will use a POST message to the REST API to start the capacity.

In the Web activity, use the following expression for the URL:
https://management.azure.com/subscriptions/@{pipeline().parameters.subscription}/resourceGroups/@{pipeline().parameters.resourcegroup}/providers/Microsoft.Fabric/capacities/@{pipeline().parameters.capacity}/resume?api-version=2022-07-01-preview
This time we’re calling the resume endpoint. The method is set to POST, and a dummy body is specified. The same settings are used for the authentication as in the other Web activity.

When we debug the pipeline, we see the Web activity calls the API to start the capacity.

If the capacity is already running, the Web activity inside the If condition is not executed:

Keep in mind that the API call is asynchronous, meaning ADF will not report if there was an error starting the capacity. A succeeded Web activity means the API call was successfully made but doesn’t necessarily mean the capacity is started. You could extend the pipeline with a Wait activity and then another Web activity that checks if the capacity has actually started.
If you want to pause a capacity, you can use the suspend endpoint. A good use case for a pipeline that shuts down a capacity is one that runs at the end of every business day. This would prevent unnecessary costs if the capacity would run all night with no one to use it.
Conclusion
In this tip, we’ve shown you how to build a simple pipeline in ADF that will resume a paused Fabric capacity. A Fabric capacity cannot start itself, so it’s not possible to build a Fabric pipeline where you start your one and only capacity. You would need another capacity or a P-SKU capacity; both incur extra costs.
The downside of this functionality in ADF (or another tool like Azure Logic Apps) is that not all logic is consolidated in Microsoft Fabric itself.
Next Steps
- If you haven’t already, check out the tip, What is Microsoft Fabric?
- Keep your eye on MSSQLTips.com for more Fabric tips!

Koen Verbeeck is a seasoned business intelligence consultant with over a decade of experience with the Microsoft Data Platform. He holds several certifications, including Azure Data Engineer. He’s a prolific writer, with over 375 articles on technologies such as Microsoft Fabric, SSIS, ADF, SSAS, SSRS, MDS, Power BI, Snowflake and Azure services. He has spoken at various events such as PASS, SQLBits, dataMinds Connect and many others. He frequently delivers educational webinars on MSSQLTips.com. For his efforts, Koen has been awarded the Microsoft MVP data platform award for many years.
- MSSQLTips Awards:
- Leadership Award (200+ Tips) – 2021
- Author of the Year – 2014/2020/2022
- Author Contender – 2024/2025



The runbooks are depriciated or at least some service that is associated with those. Tomorrow actually.
Hi, there’s a Runbook for this, check it out at https://learn.microsoft.com/en-us/fabric/enterprise/pause-resume#schedule-your-operation
Hi Koen,
Some more info is here: https://github.com/nocsi-zz/fabric-capacity-management/tree/main/fabric-data-pipelines
Regards, Chris
Hi Chris,
I don’t think I actually found any documentation. I just searched again, and the endpoints aren’t listed in the official Azure REST API documentation.
I remember I was complaining on Twitter a while back about the lack of automation, and someone sent me a link to an example using these API endpoints.
Koen
Hi Koen,
Where did you find the documentation for the resume and suspend endpoints?
Regards,
Chris
To suspend:
https://management.azure.com/subscriptions/<subs>/resourceGroups/<rg>/providers/Microsoft.Fabric/capacities/<capacity>/suspend?api-version=2022-07-01-preview
Hi Julien,
you’re using the regular Azure API. In order to make it work, I had to add ADF as a contributor to the Fabric capacity. You might have to do the same thing with your app.
Regards,
Koen
Hi Sumeet,
I mention at the end of the article that the suspend endpoint should be used.
Regards,
Koen
Worked great with – https://management.azure.com/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Fabric/capacities/xxx/suspend?api-version=2022-07-01-preview
Thanks a ton!
Resume activity works fine.
Pause acivity does not work, using the api call – https://management.azure.com/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Fabric/capacities/xxx/pause?api-version=2022-07-01-preview
Return 404 error code.
Any help is appreciated. Thanks in advance.
Hi, i am trying to make it work programmatically, making API call. I need in the Header , in the Autorisation , the token.
I have created an app, and I can get the token from this app. But , still get the error message :
code”:”AuthorizationFailed”,”message”:”The client ‘XXX’ with object id ‘XXX’ does not have authorization to perform action
| ‘Microsoft.Fabric/capacities/read’
In the API permission of the app, there is not Fabric api available. Only POWER BI capacity, but it doesn’t work.
What are the API permission we have to add for an Application ? thank you.
I tried the demo and it worked as explained!!!