Microsoft Fabric capacities can become a significant expense if they are left running when not actively in use. In this training session from Pragmatic Works, data engineer trainer Zane Goodman walks through a practical and cost‑effective approach to automatically turning Fabric capacities off using Azure Data Factory (ADF) pipelines.
By combining Azure APIs, Azure Data Factory activities, and Teams notifications, organizations can ensure their Fabric environments are optimized for both performance and cost control.
Zane begins by highlighting the cost implications of Microsoft Fabric capacities. Higher-tier capacities, such as an F‑128, can cost nearly $17,000 per month, while even smaller capacities like an F‑16 can reach approximately $2,000 monthly. Without automation, it is easy for unused capacities to remain active overnight or during non-business hours.
The goal of this solution is simple: automatically pause Fabric capacities when they are not needed, helping teams avoid unnecessary spending.
Although Fabric pipelines may appear to be a logical choice, Zane explains why Azure Data Factory is better suited for this scenario. If a pipeline designed to shut down a Fabric capacity is running on the same capacity, it can create dependency and reliability issues.
Azure Data Factory avoids this problem because:
The automation begins with a simple but critical requirement: access to Fabric capacity metadata. Zane stores this information in a CSV file located in Azure Data Lake Storage Gen2. The file contains three essential fields:
An ADF Lookup activity reads this file and outputs an array of capacity records. This approach provides flexibility, allowing teams to control exactly which capacities are included in the automation process.
Once the capacity data is retrieved, the pipeline uses a ForEach activity to process each capacity individually. This ensures every capacity is evaluated and handled correctly.
Inside the loop, a Web activity calls the Azure Management API to determine whether the capacity is currently active or paused. This step is critical to prevent errors that would occur if the pipeline attempted to pause an already inactive capacity.
The pipeline uses an If Condition activity to evaluate the state returned by the API:
This conditional logic ensures clean execution while maintaining visibility into the status of all capacities.
Rather than assuming the suspend operation succeeded, Zane demonstrates a best practice by confirming the capacity state with a second API call. This validation step guarantees the capacity is truly paused.
After confirmation, the pipeline prepares a Teams adaptive card containing key details such as:
The adaptive card is then sent to a Teams channel using a webhook, providing immediate visibility and peace of mind that capacities are no longer running.
To fully automate the process, the pipeline uses an Azure Data Factory trigger. In this example, capacities are automatically turned off daily at 6:00 PM. This schedule can be adjusted to align with business hours, overnight workloads, or maintenance windows.
Multiple triggers can also be created to support different operational requirements.
For the pipeline to control Fabric capacities, proper permissions are required. Zane explains how to use ADF’s system-assigned managed identity and grant it a custom role at the resource group or capacity level.
The required permissions include:
Once assigned, the pipeline can securely manage Fabric capacities without storing credentials.
This Azure Data Factory solution provides a reliable, scalable way to control Microsoft Fabric capacity costs. By combining automation, validation, and notifications, organizations gain confidence that resources are only running when needed.
Zane emphasizes that this pattern is frequently implemented during consulting engagements and Fabric migrations, helping clients avoid costly oversights. With minimal effort, teams can extend this approach to also resume capacities, customize alerts, or integrate additional governance controls.
Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Fabric and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.