Home
fabric-cicd is a Python library designed for use with Microsoft Fabric workspaces. This library supports code-first Continuous Integration / Continuous Deployment (CI/CD) automations to seamlessly integrate Source Controlled workspaces into a deployment framework. The goal is to assist CI/CD developers who prefer not to interact directly with the Microsoft Fabric APIs.
Base Expectations¶
- Full deployment every time, without considering commit diffs
- Deploys into the tenant of the executing identity
- Only supports items that have Source Control, and Public Create/Update APIs
Supported Item Types¶
- ApacheAirflowJob
- CopyJob
- DataAgent
- DataPipeline
- Dataflow
- Environment
- Eventhouse
- Eventstream
- GraphQLApi
- KQLDashboard
- KQLDatabase
- KQLQueryset
- Lakehouse
- MirroredDatabase
- MLExperiment
- MountedDataFactory
- Notebook
- Ontology
- Reflex
- Report
- SemanticModel
- SparkJobDefinition
- SQLDatabase
- UserDataFunction
- VariableLibrary
- Warehouse
Installation¶
Requirements: Python 3.9 to 3.13
To install fabric-cicd, run:
Basic Example¶
from azure.identity import AzureCliCredential
from fabric_cicd import FabricWorkspace, publish_all_items, unpublish_all_orphan_items
token_credential = AzureCliCredential()
# Initialize the FabricWorkspace object with the required parameters
target_workspace = FabricWorkspace(
workspace_id="your-workspace-id",
environment="your-target-environment",
repository_directory="your-repository-directory",
item_type_in_scope=["Notebook", "DataPipeline", "Environment"],
token_credential=token_credential, # or any other TokenCredential
)
# Publish all items defined in item_type_in_scope
publish_all_items(target_workspace)
# Unpublish all items defined in item_type_in_scope not found in repository
unpublish_all_orphan_items(target_workspace)
Notes:
- All parameters for
FabricWorkspacemust be passed as keyword arguments.- The
environmentparameter is required for parameter replacement to work properly. It must match one of the environment keys defined in yourparameter.ymlfile (e.g., "PPE", "PROD", "DEV"). If you don't need parameter replacement, you can omit this parameter.