Skip to content

Start/Stop Suspend/Resume and Scale Microsoft Fabric Capacities with Managed Identity Python Runbook

License

Notifications You must be signed in to change notification settings

jugi92/manage_fabric_capacity_python_runbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Suspend or Resume Fabric Capacity

Usage

Python

Use the python script via command line like

python3 manage_fabric_capacity.py.py /subscriptions/12345678-1234-1234-1234-123a12b12d1c/resourceGroups/fabric-rg/providers/Microsoft.Fabric/capacities/myf2capacity suspend

Parameters

Resource ID (required):

Resource ID of the Capacity, can be found in the Azure Portal on the resource overview page in the top right when clicking on JSON View.

Operations (required):

Can be either suspend, resume or scale

SKU (optional):

Required if operation = scale, some SKU between F2 to F2048

Azure Automation Runbook

To use the script as an Azure Runbook, the authentication will happen via the System Assigned Managed Identity of the Automation Account. That identity will need to have contributor rights on the Fabric Capacity resource.

Create Runbook: Create Runbook

Choose from Gallery: Choose from Gallery

Search Gallery for "Fabric": Search Gallery for "Fabric"

Name the Runbook and select Python Runtime (currently only Python 3.8 supported, 3.10 is still in preview and does not include requests package): Name the Runbook and select Python Runtime

Publish the runbook: Publish the runbook

Go to schedules: Go to schedules

Get Ressource ID of your Fabric Capacity Get Ressource ID of your Fabric Capacity

Copy the Ressource ID Copy the Ressource ID

Put Capacity ID and the Operations (e.g. "suspend") as parameter Put Capacity ID and the Operations (e.g. "suspend") as parameter

Create Identity for Automation Account and copy the Object ID Create Identity for Automation Account and copy the Object ID

On the Fabric Capacity assign the contributor role to the Automation Account Object ID On the Fabric Capacity assign the contributor role to the Automation Account Object ID

About

Start/Stop Suspend/Resume and Scale Microsoft Fabric Capacities with Managed Identity Python Runbook

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages