Source Control for Power BI (Azure DevOps, GIT)

TABLE OF CONTENTS

OVERVIEW

Source control is a powerful tool for development teams; from version control, qualifying deliverables (i.e., peer-review check-in), and the ability for multiple developers to work on the same project simultaneously, the benefits of incorporating this tool into your workflow can’t be overstated.

Microsoft has launched two amazing features for Power BI to enable the dynamic benefits of source control: (1) GIT integration with Power BI (Power BI Desktop projects Git integration and Manage a workspace with Git (preview)) and (2) Power BI PBIP files (Power BI Desktop projects (PREVIEW)). The crux being that you can now save your binary PBIX files as file structured PBIP files that allow for transparency in changes in a organized fashion, and those file changes can be committed to GIT and synced with your Power BI workspace.

The audience and scope of this article is intended for anyone looking to get GIT integration quickly with Power BI, tailored for the small-mid size development teams.

PREREQUISITES

  • A ‘Premium Capacity’: This could be a Premium Per User account, Premium Capacity License, or a new Fabric License (PBI GIT Prerequisites)
  • Visual Studio Code (VS Code): This software bridges your local environment with Azure DevOps. (Download: VS Code)
  • A local GIT Instance: This will be your local GIT instance that connects with Azure DevOps (Download: GIT)
  • An Azure DevOps Account: You can create a free account associated with your Microsoft license. It must be associated with the same account used for your PBI access. (Create Account: Azure DevOps)

SETTING UP AZURE DEVOPS

1.    Create An Organization

Once you’ve created your account, you will need to create a new ‘Organization’. As mentioned earlier, we are trying to keep this as cost effective as possible for the small-mid size development team. Therefore, we will create one solution for our organization/department (subdividing by workspace later).

For this Demo, we are going to name the organization, “AnalyticalAntsDemo”.

2.    Create a Project

Now we need to create a Project. I’m going to scope this large enough so that multiple projects can be ingested here (e.g., multiple Power BI Workspaces, etc.). Let’s call this “AnalyticalAntsDemo” and setting the Visibility to private.

3.    Creating a Repo

For starters, make sure the project can create repositories. In the bottom left, click ‘Project settings’, then scroll down (you should be in General > Overview (left hand) and make sure Repos is turned on under Azure DevOps services.

Now, let’s create a Repo. Click on Repo (one should be created) and ‘Initialize the main branch’ at the bottom.

Now, let’s create different subfolders for our Power BI environments. This way, we can link multiple workspaces to their own folder within this repository. I’m going to call the new folder ‘Workspace GITDemo’ and create a new Readme file.

On the next screen (commit) I’m going to select Commit (and commit again)

Now your Azure DevOps repo and folder structure is set up! Two more steps: (1) Let’s sync this repo with our local environment and (2) let’s connect this repo to Power BI.

SETTING UP YOUR LOCAL ENVIRONMENT

From the Azure DevOps repo, select ‘Clone’ and then ‘Clone in VS Code’ (see images below). This will automatically open VS code and ask you to create a local folder for this repository. You want the local Repo folder to be close to your root directory as there is a character path limit for the PBIP files (PBIP Considerations and Limitations). Make sure to sign in to your Microsoft Account when prompted.

That’s it! Your local environment is done! To maximize the experience, make sure to save your PBIX files to this folder as PBIP files. When you need to make adjustments, make sure to edit the PBIP files here and then push through source control. Let’s cover that quickly.

CHECKING IN VIA SOURCE CONTROL

This will be a brief introduction on checking in your PBI code via Source Control. We will not be covering branching, merging, approving, etc. You can find a more detailed review on that here: Microsoft, Share your code with GIT.

1.    Adding Changes

Save changes to the workspace folder within this repo (make sure to save as a PBIP file!). Now, go to visual studio > source control, and you will see all the changes you’ve made. Go ahead and ‘Stage All Changes’.

Now, enter a ‘message’ to capture the essence of the check-in. Something like the ‘User Initials – Short Description of work’. Now, we will ‘Commit’ and ‘Sync Changes’.

That’s it! Now your code online has the same work as your local. Now, you will (1) have a record of changes (2) have versioning control (3) be able to sync your PowerBI workspace based on your local work!

SETTING UP POWER BI WITH GIT

We will go to the target PBI workspace (or create one), go to Workspace settings, and connect to our new GIT folder and repo! Note that everything is a drop down pick-list except for the GIT folder. Make sure to type in the workspace folder name that we created earlier. Once done, press Connect and sync.

That’s it! Now your environments are tied! You can click ‘Source control’ anytime to sync your PBI workspace with GIT, and vice versa. You can even branch from Power BI and check-into GIT. Any changes will be displayed in the ‘Source Control’ moniker. Very cool!

CONCLUSION

Power BI integration with GIT will bring many powerful improvements to your current workflow. The best part is that these integrations have been made extremely accessible by Microsoft. If you need any additional guidance on anything Microsoft/Power BI related, feel free to reach out to us!


About the Author:
William Rodriguez is the founder and principal consultant of Analytical Ants, an analytics company focused on procuring insights via data engineering, data science, and data analysis. William has led multi-million-dollar construction projects, acted as financial controller managing million-dollar monthly check productions, and built and deployed BI infrastructures at companies large ($30B Revenue) and ‘small’ ($60M Revenue). Academically, he has his master’s in business, two undergraduate business degrees, four active Microsoft certifications, and over 70 accredited SQLBI training hours. William loves spending time with his amazing family and knows that he would be nowhere without Christ.

Reach out to Analytical Ants LLC for all your data/analytical needs. We specialize in #DataEngineering #DataScience, and #DataAnalysis.

Shopping Cart