https://github.com/jugi92/manage_fabric_capacity_python_runbook
Start/Stop Suspend/Resume and Scale Microsoft Fabric Capacities with Managed Identity Python Runbook
https://github.com/jugi92/manage_fabric_capacity_python_runbook
azureautomationrunbookgallery fabric msfabric python3
Last synced: 16 days ago
JSON representation
Start/Stop Suspend/Resume and Scale Microsoft Fabric Capacities with Managed Identity Python Runbook
- Host: GitHub
- URL: https://github.com/jugi92/manage_fabric_capacity_python_runbook
- Owner: jugi92
- License: other
- Created: 2024-02-05T16:30:37.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-12T15:48:51.000Z (about 1 year ago)
- Last Synced: 2025-03-28T06:01:30.537Z (about 1 month ago)
- Topics: azureautomationrunbookgallery, fabric, msfabric, python3
- Language: Python
- Homepage:
- Size: 1.48 MB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
README
# 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:
Choose from Gallery:
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):
Publish the runbook:
Go to schedules:
Get Ressource ID of your Fabric Capacity
Copy the Ressource ID
Put Capacity ID and the Operations (e.g. "suspend") as parameter
Create Identity for Automation Account and copy the Object ID
On the Fabric Capacity assign the contributor role to the Automation Account Object ID
