To automate Microsoft Fabric startup and shutdown on a schedule, you can use several approaches depending on whether you're automating job execution within Fabric or capacity management (i.e., pausing/resuming Fabric capacity to optimize costs). Here's a breakdown of both:
π Automating Jobs in Microsoft Fabric
Microsoft Fabric includes a built-in Job Scheduler that allows you to automate tasks like data refreshes, pipeline executions, and notebook runs:
Key Features:
- Recurrence options: Minute-based, hourly, daily, weekly, monthly, or specific dates.
- Multiple schedules: You can configure different schedules for the same item.
- CI/CD integration: Schedules can be included in deployment pipelines or managed via Git using
.schedules
files. - Access: Right-click on an item (e.g., Notebook) in your Fabric workspace and choose Schedule [1].
Setup Steps:
- Open your Fabric workspace.
- Locate the item (Notebook, Pipeline, etc.) you want to schedule.
- Click the contextual menu β Schedule.
- Toggle the scheduler On and configure timing.
- Save the schedule.
ππ Automating Fabric Capacity Start/Stop (Pause/Resume)
This is useful for cost optimization, especially if your organization doesnβt need Fabric running 24/7.
β Option 1: Azure Automation + PowerShell
Use a PowerShell script in an Azure Automation Account to pause/resume Fabric capacity:
- Script: Uses REST API calls to
resume
orsuspend
Fabric capacity. - Authentication: Managed Identity.
- Scheduling: Azure Automation Schedules (e.g., resume at 8 AM, suspend at 5 PM).
- Permissions: Assign Contributor role to the Automation Account on the Fabric resource [2].
GitHub repo with script and setup guide
β Option 2: Azure Logic Apps
Create a Logic App workflow to automate based on time and capacity status:
- Trigger: Recurrence (e.g., every hour).
- Actions:
- Get current time and convert to local timezone.
- Check Fabric capacity status via Azure Resource Manager.
- Resume if paused during working hours.
- Suspend if running outside working hours.
- Bonus: Add conditions to skip weekends [3].
- Resume if paused during working hours.
- Check Fabric capacity status via Azure Resource Manager.
- Get current time and convert to local timezone.
Detailed tutorial with screenshots
β Option 3: Azure Automation with Python
Similar to PowerShell, but uses Python runbooks:
- Requires app registration and secret management via Azure Key Vault.
- Uses Azure SDK for Python (
azure-identity
,azure-core
, etc.). - Schedule runbooks with triggers for resume/suspend actions [4].