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.
You can commit the mirrored database changes to Git, or update the workspace from Git by clicking the Source control.
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:
mirroring.json
file which is the definition of the Mirrored database. Learn more about Mirrored database item definition.platform
file which is auto generated by the system. Learn more from system file.
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:
Create a deployment pipeline, refer to Get started with deployment pipelines.
Assign workspaces to different stages according to your deployment goals.
Select, view, and compare items including mirrored database between different stages.
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.
(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.
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.
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.
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.