Building CI/CD in Power BI Projects with Fabric Git Integration & Deployment Pipelines
Introduction
Power BI now offers a robust foundation for managing development and deployment workflows efficiently, thanks to Git integration in Microsoft Fabric, which has transformed how we manage Power BI projects.
Combined with features like the structured .PBIP
(Power BI Project) format and Fabric deployment pipelines, this integration streamlines version control and enhances collaboration.
This article explores how to build CI/CD processes for Power BI projects, using Azure DevOps (though the approach applies to GitHub as well).
Goals:
The purpose of this article is to demystify the various options for building CI/CD processes in Microsoft Fabric, highlighting best practices and showcasing how Git integration and deployment pipelines can enhance workflows.
Architecture Overview:
We will implement the following architecture:
Continuous Integration (CI) - Development Approaches:
We will adopt two development approaches for manage the CI process:
Using Power BI Desktop: Modify reports locally in Power BI Desktop and push changes to a Feature branch via VS Code.
Using Power BI Service: Develop directly in the Power BI Service within a dedicated Feature workspace, then sync changes back to the Feature branch in Git.
Workspace & Branch Configuration:
To ensure effective collaboration and version control, we will organize our environment as follows:
DEV Workspace: The shared team workspace, connected to the Main branch in Azure DevOps repository.
Feature Branches: Developers work in isolated feature branches for safe updates.
Merging: Changes in feature branches are merged into the Main branch. Once merged, updates sync automatically to the DEV workspace.
Continuous Deployment (CD):
For the CD process, since the Main branch is already connected to the DEV workspace, we will use Deployment Pipelines in Fabric to deploy changes from DEV to the TEST and PROD workspaces.
Implementing CI/CD Steps:
Perquisites:
1- Set up Azure DevOps Project & Connect Git repository and branch:
Create a repository in Azure DevOps and connect the DEV workspace to Git.
2- Sync DEV Workspace content with Main Branch:
Publish a PBIP project to DEV and synchronize the content from the workspace to the Main branch
CI: Development process
The Fabric workspace is a shared environment that accesses live items. Any changes made directly in the workspace override and affect all other workspace users. Therefore, Git best practice is for developers to work in isolation outside of the shared workspaces.
Approach 1: Develop using a Feature Workspace
In this approach, each developer works in a dedicated feature workspace connected to an isolated feature branch.
👇👇Check out this demo to learn how to manage the CI process with Fabric Git Integration when a developer works directly in the Power BI Service.
Summary of Steps:
Branch Out:
From the DEV workspace (linked to the Main branch), branch out to a new feature workspace.
Create an Isolated Feature Branch
A new branch and corresponding private workspace are generated, isolating your changes.
Develop and Commit
Make your changes in the private workspace and commit them to the Feature branch.
Merge Changes to Main
Once your updates are complete, create a PR to merge the Feature branch into the Main branch.
Sync Updates in the shared workspace:
After merging, the shared DEV workspace will prompt users to accept the new commit.
Update the DEV workspace by applying the latest changes from the Git repository to the workspace.
Approach 2: Develop using Power BI Desktop
This approach is suitable for local development:
👇👇Check out this demo to learn about developing with Power BI Desktop and VS code.
Summary of Steps
Clone the Repository
Use VS Code to clone the repository to your local machine.
Save the Report
Open the report in Power BI Desktop and save it as a
.pbip
file in the same cloned repository.
Create a New Branch
Start by creating a new branch for your isolated work.
Collaborate with Branches & Commit Changes
Commit changes locally push them to the remote repository in the isolated branch, and create a PR to merge your changes into the Main branch.
Sync Updates in the Shared DEV Workspace
After merging, the shared DEV workspace will prompt users to accept the new commit from Git to the workspace.
Once accepted, the semantic models and reports in the shared workspace will update, allowing the entire team to view the changes.
CD: Deployment Process
Fabric deployment pipelines help simplify the CD process by automating the deployment of changes across multiple environments.
Use Deployment Pipelines:
Promote changes from DEV to TEST and then to PROD.
Validate content at each stage before moving to the next environment.
By leveraging Fabric deployment pipelines, the transitions between environments are smooth and reliable.
👇👇Check the demo bellow:
Conclusion
Git integration and Fabric deployment pipelines provide a robust framework for managing Power BI projects. By following these best practices for CI/CD, teams can enhance collaboration, improve project efficiency, and deliver high-quality updates seamlessly.
Links:
𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐢𝐧𝐠 𝐧𝐞𝐰 𝐛𝐫𝐚𝐧𝐜𝐡𝐢𝐧𝐠 𝐜𝐚𝐩𝐚𝐛𝐢𝐥𝐢𝐭𝐢𝐞𝐬 𝐢𝐧 𝐅𝐚𝐛𝐫𝐢𝐜 𝐆𝐢𝐭 𝐢𝐧𝐭𝐞𝐠𝐫𝐚𝐭𝐢𝐨𝐧
Fabric Git integration, essential to the Fabric CI/CD toolkit, allows developers to link their Fabric workspaces to Git repositories for version control and collaboration.
𝐏𝐨𝐰𝐞𝐫 𝐁𝐈 𝐄𝐧𝐭𝐞𝐫𝐩𝐫𝐢𝐬𝐞 𝐂𝐨𝐧𝐭𝐞𝐧𝐭 𝐏𝐮𝐛𝐥𝐢𝐬𝐡𝐢𝐧𝐠 𝐃𝐢𝐚𝐠𝐫𝐚𝐦 🎉
Collaboration among Power BI developers plays a crucial role in delivering impactful insights for organizations. Ensuring delivery of content to consumers is a challenge effectively met through a combination between Azure DevOps & Power BI & Git Integration.