CI/CD for mirrored databases in Fabric (Preview)

This article explains how Git integration and deployment pipelines work for mirrored databases in Microsoft Fabric. Learn how to set up a connection to your repository, manage your mirrored databases through Git, and deploy them across different environments.

Note

This CI/CD instruction doesn't apply to mirrored database from Azure Databricks.

Mirrored database Git integration

From your workspace settings, you can easily set up a connection to your repo to commit and sync changes. To set up the connection, see Get started with Git integration article.

After you connect, the workspace displays information about source control that allows you to view the connected branch, the status of each item in the branch, and the time of the last sync.

Screenshot showing the Fabric workspace with Git status and other details reported for mirrored database.

You can commit the mirrored database changes to Git, or update the workspace from Git by clicking the Source control.

Screenshot of committing mirrored database changes to Git.

Mirrored database representation in Git

When you commit the mirrored database item to the Git repo, a folder is created for each item and named {display name}.MirroredDatabase. It contains two files:

Screenshot of mirrored database representation in Git.

Note

Only the mirrored database item is tracked in Git. SQL Analytics endpoint, default semantic model, and other child items (for example, created views) aren't tracked.

Mirrored database in deployment pipelines

You can use Fabric deployment pipeline to deploy your mirrored database across different environments, such as development, test, and production. And you can use deployment rules to customize the source databases to mirror.

Take the following steps to deploy your mirrored database using deployment pipeline:

  1. Create a deployment pipeline, refer to Get started with deployment pipelines.

  2. Assign workspaces to different stages according to your deployment goals.

  3. Select, view, and compare items including mirrored database between different stages.

  4. Select Deploy to deploy your mirrored database across the stages. You may see warning saying the item (SQL analytics endpoint) is not supported, ignore and continue.

    Screenshot of deployment pipeline for mirrored database.

  5. (Optional) To mirror a different source database from the previous stage, select Deployment rules to create deployment rules for a deployment process. Deployment rules entry is on the target stage for a deployment process.

    Screenshot of the deployment rule entry point.

    Fabric supports parameterizing the source database for each mirrored database item when deploying with deployment rules. Select the corresponding mirrored database -> Data source rules -> + Add rule, input the target connection ID and optionally database if applicable to your source database type. You can find the connection ID from Manage connections and gateways -> find the created connection from the list -> Settings -> Connection ID field.

    Screenshot of configuring a data source rule for your source database connection.

    After you create the deployment rules, deploy the mirrored databases with the newly created rules from the source stage to the target stage where the rules were created. Your rules don't take effect until you deploy the mirrored database from the source to the target stage.

  6. Monitor the deployment status from Deployment history.

Important

Mirrored database isn't started after deployment. You need to start it manually or through API.

Note

Currently, child items like created views aren't deployed across stages.