Version-control & CI/CD your Power BI reports: Using Fabric's Git Integration & Deployment pipelines

Git integration empowers you to streamline your development workflow, collaborate and maintain version control for your Power BI reports within the Fabric ecosystem; with deployment pipelines, you can define a series of steps that move your report from development to production environments.

Version-control & CI/CD your Power BI reports: Using Fabric's Git Integration & Deployment pipelines

Setting the stage

Microsoft Fabric allows developers to seamlessly integrate their development processes, tools, and best practices directly into the Fabric platform, with Fabric Git integration feature, you can use Git branches to work collaboratively and keep track of changes and revert to previous stages as needed

The integration operates at a workspace level, enabling developers to version items within a workspace with full visibility to all their items.

Fabric Deployment Pipelines are a powerful feature within the Microsoft Fabric ecosystem, they enable you to automate and easily deploy your Power BI reports to different environments (e.g., development, staging, production) and to run tests and validations during the deployment process and roll back to a previous version if issues arise.

Both Fabric features Git-Integration and Deployment Pipelines are part of it's Premium Capacity, I'm not going to discuss anything with regards to licensing nor costs, I can say however that I configured the workspaces created for this article using the free trial per user license as shown below.


Solution

I'm assuming that you have an existing fully functional Power BI report (.pbix), at least two environments Dev & Prod and their corresponding data sources, in my case, I have my report connected to an Azure SQL Database also deployed via DevOps pipelines, check this article Create a Visual Studio Database project, host in DevOps Git-repo and deploy with pipelines

You would also need to have access to the Git Repos service in Azure DevOps (check my article on this topic for assistance Azure Account vs DevOps Account)

It is also fair to assume that you have access Power BI Online service and the ability to create workspaces with Premium capacity (via your company or a free trial per-user license) or access to an existing one... if so ๐Ÿ˜๐Ÿคž, let's move forward!

Creating our Git Repository

Create a new repository in Azure DevOps (AzDO) Git Repo service

In my case, since I'll use the same infrastructure for the article series, hence, I'm creating new feature branch from main; this branch would be my collaboration branch

๐Ÿค“
In Microsoft Fabric, the collaboration branch plays a crucial role in integrating your development processes and best practices directly into the Fabric platform

Configure Fabric's Git-Integration

Create new Development workspace, make sure license mode apply to the workspace grants Premium capacity.

Connect your workspace to your previously created AzDO Git Repo

Click Upload and browse to any existing fully functional Power BI report (.pbix)

I did it with my report, and this is what I've got! Notice how Source Control shows two new files, we need to commit the changes by clicking the Commit button.

Here comes the "tricky" part, if we go back to the repository to see the recent committed changes, you no longer see the .pbix file ๐Ÿ˜ฌ... the report was deconstructed into a Power BI project with the Report and the Semantic Model separated as shown below! ๐Ÿคฏ

From this point forward, we will have to use the branching strategy of our choosing to introduce changes... let me show you

Opening your Power BI project with Desktop

Let's start by cloning locally our branch, I'm using Visual Studio

Let's open Power BI Desktop and let's enable "Power BI Project (.pbip) save option" from Options and Settings > Options > Preview features.

Let us now navigate to the local path where your branch content got created, locate and click on the .pbir file.

๐Ÿค“
The .pbir file contains the overall definition of a report and core settings.It also holds the reference to the semantic model used by the report.

And now, a very familiar sight ... this is my report ๐Ÿคฉ

I'm going to remove the Card "Account Balance" located on the lower right corner and click save, this will introduce a change. Go back to the source code and noticed the change in the report.json file ... this is awesome ๐Ÿ˜Ž! We can now track all the changes being made on the report ๐Ÿ˜

Check in the changes and push your local branch back to origin.

Back on Power BI Online service, we can see source code detected the changes, we just need to click on Update all

Our content was sync and we are now ready to build our deployment pipeline!

Create our Fabric's Deployment Pipeline

We have at this point a Git-Integrated Development environment, let's now create our production workspace (deployment pipeline's target environment)... make sure license mode apply to the workspace grants Premium capacity.

And now we are ready to create our Deployment pipeline.

Click on + New Pipeline, and let's give it a name

For simplicity, I'm going to use just Development and Production, so, let's customize the stages to reflect this.

Assign workspaces to each stage accordingly

And now, let's Deploy the content in our Development workspace into our Production workspace!

After deploy, we have our Workspaces in sync, that is, the report definition has now been published to a new Production workspace.

Let's finalize by pointing our semantic model to its corresponding source, that is, pointing the source for our development to a development database and production to the production database.

And we are done, we can now introduce any new changes and follow the cycle all over again!


Conclusion

Git integration empowers you to streamline your development workflow, collaborate efficiently, and maintain version control for your Power BI reports within the Fabric ecosystem, with deployment pipelines, you can define a series of steps that automatically move your report from development to production environments.

๐Ÿ’ณ
Consider your organizationโ€™s needs and choose the right licensing model accordingly! 

Call to action

Find it useful? Hope so! Next article I'm going to discuss an alternative for Power BI Pro users, subscribe and send me your comments.