top of page
Jihwan Kim

Power BI version control and main branch vs. sub branch in Azure DevOps.

In this writing, I like to share how I create a simple "Pipeline" and create a "Release" in Azure DevOps to publish Power BI Dataset and Report to the workspace, together with how I learned to use "main Branch" and "sub Branches".


Note about Git Integration in Power BI Workspace.

If the Power BI workspace is set up to have "Git Integration - connect Git repository and branch" in the workspace setting, no need to create "Pipeline" and "Release" in Azure DevOps.


However, I noticed that when you try to amend measures and visualizations, commit the changes, and synchronize it with Azure DevOps, it only works when you fix something in the PBIP file or directly in the model.bim file via tabular editor or VS Code.

For now (2023-07-13), It does not work if you fix a measure in the PBIX file when the workspace is set up to have "Git Integration".



This writing is about how to create Pipeline and Release in Azure DevOps when you are not using PBIP, or not using Git Integration in pbi workspace. Creating Pipeline and Release are not too difficult, but still, it is an extra job. If you do not want this extra job, you can start using PBIP with Git Integration right away. And I think it is very convenient for Power BI Developers.


But here, I will briefly demonstrate how to create Pipeline and Release, and how to use Main Branch and Sub Branch to version control in Azure DevOps.

In a later blog post (perhaps one week later), I will try to describe how to use PBIP to connect to pbi workspace to version control in an easy way.



Let's start.


1. go to Azure DevOps

2. Initialize the main branch


Now, the main branch is already here.

And we are creating a sub-branch.


3~4. click + to create a new branch

5. Name the new branch.

6~7. Clone in VS code



8~9. Open Visual Studio Code



1. The same name as the Azure DevOps project name is created in your assigned folder.

Into here, bring the pbix file in. And then the pbix file will show up in Visual Studio Code.

2. In order to update this to Azure DevOps,




  1. change the view to see "Source Control Repositories"

  2. Check if it shows "main branch" -> If you want to create a new sub-branch or change it to the already-created-sub-branch, click the icon, and then you can see the option to create a new branch or assign it to a different branch. Later part of this blog post, you will need this to update the amendment of pbix file to a new sub-branch.

  3. confirm the changes



And then commit the changes with the name "Save PBIX file"

Synchronize it.





You can see this in Azure DevOps.




1~5. In order to publish to the workspace, create Pipeline and Release







1. Type in like below, and then the word "Setting" will show.

2. Click "Setting", and then fill in the information on the right side of the screen.




1~4. Type in like below, and then click the word "Setting". Add it, and "Save and run".




Now, Pipeline is created.

It is time to create Release. Follow the below diagrams.





When entering the workspace name ( in my sample, the workspace name is DevOps ), make sure that the workspace is configured in a proper way. How to configure it in a proper way is shown in my previous blog post => Power BI Development Version Control with Azure DevOps - Start to practice using pbip file. (jihwankimcscp.wixsite.com)




And, if you cannot fill in 11 above, try to click the New button, and fill in the below.

All the information for the below can be seen in Azure Active Directory.


where to find the information above in Azure Active Directory is shown below.

Be noted that also "Groups" has to be created to configure PBI workspace.



Back to Azure DevOps.





And now, pbi report is published to the workspace.




Fixing and changing PBIX file


Let's say, the report in the main branch looks like below.



If you need to fix the pbix file, fix it and commit and synchronize it in VS Code under the sub-branch name, not under the main branch.

And then go to Azure DevOps and release the same pipeline again.


For instance, in this scenario, I will change the pbix file two times.

In the first step, I changed one visualization, and commit under sub-branch name -> synchronize in VS Code.

In the second step, I fixed the visualization again, and commit under the same sub-branch name -> synchronize in VS Code.

As shown below, in the Sub Branch, there are two changes described.




If you want to confirm the last change, and if you want to pull this Sub Branch to the main branch, follow the below steps.









And then, you can see that the Sub Branch is pulled into the main branch like below.






Once you release the same pipeline again, the visualization in the pbi workspace will be updated.



However, if you do not want the last change in the Sub Branch, but if you want the previous one in the Sub Branch (below picture),




Release the same pipeline again, but this time, change the version like below.




And then, pbi workspace will be updated again.





Make sure that you Tag each change and step properly in the flow of the main branch in order to track what version is used in the pbi workspace.



I briefly described how to create Pipeline and Release, and how to manage changes in pbix file by using Azure DevOps in order to version-control.

Next time, I will describe how to do this in a very simple way by using a PBIP file and Git Integration configuration in the PBI workspace.


I hope this helps to have more fun in version-controlling Power BI.

956 views0 comments

Comentarios


bottom of page