Skip to content

Getting Started

Installation

To install fabric-cicd, run:

pip install fabric-cicd

Prefer a command-line experience over writing Python?

If you'd rather not write Python, the Microsoft Fabric CLI (fab) includes a deploy command that runs fabric-cicd under the hood. It deploys Fabric items to a workspace directly from the command line using a shared config.yml file. See Deploying with the Fabric CLI for details.

Authentication

⚠️ NOTICE: Due to security best practices, the Default Credential (DefaultAzureCredential fallback) and implicit Fabric Notebook authentication (without a token_credential parameter) methods are no longer supported. token_credential is now a required parameter.

  • You must provide your own credential object that aligns with the TokenCredential class (from azure.identity). For more details, see the TokenCredential documentation.
  • When running in Fabric Notebook runtime, provide an explicit credential. See Authentication examples for details.

Recommended Authentication Methods:

  • For local development: AzureCliCredential or AzurePowerShellCredential (user authentication)
  • For CI/CD pipelines: AzureCliCredential/AzurePowerShellCredential (platform authentication), ClientSecretCredential (service principal), or ManagedIdentityCredential (self-hosted agents)

Basic Example:

from azure.identity import AzureCliCredential
from fabric_cicd import FabricWorkspace

token_credential = AzureCliCredential()

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
)

See the Authentication Examples for specific implementation patterns.

Directory Structure

This library deploys from a directory containing files and directories committed via the Fabric Source Control UI. Ensure the repository_directory includes only these committed items, with the exception of the parameter.yml file.

/<your-directory>
    /<item-name>.<item-type>
        ...
    /<item-name>.<item-type>
        ...
    /<workspace-subfolder>
        /<item-name>.<item-type>
            ...
        /<item-name>.<item-type>
            ...
    /parameter.yml

Next steps