CI/CD in Power BI to simplify Release Management in five simple steps
Tags: devops, powerbi, cicd, deployment
Published: 2022-11-09 11:37:18

Before I dive deep into the main topic of CI/CD ( Continuous Integration and Continuous Delivery) of Power BI, I would like to give a very quick overview of Power BI.

Power BI is a popular and powerful BI ( Business Intelligence ) tool. For four consecutive years, Power BI has been reported as a leader in the Gartner Magic Quadrant ( link to garnet in 1st comment ). Other popular BI tools are Tableau, Microstrategy, Qlik Sence, Superset, and many more; the list is long. 


The primary function of any BI Tool is to:

1. Collect and transform data from multiple sources
2. Help uncover the data trends and outliers
3. Help create easy and impactful data visualization
4. Action-oriented insights



> "Gartner has recognized Microsoft Power BI as a Magic Quadrant Leader in analytics and business intelligence platforms."


As the business grows, it needs more analytics, more accurate data in a single report, and quick access to trends; as a developer, the challenge is the get out the dashboards and reports in the fastest possible way along with reliable data, which is more recent, more accurate, more realtime. Manual deployments are error-proper and time-consuming, so CICD comes to the developers' rescue.



>"Doing deployments and release management manually can be error-prone and time-consuming."


## CI/CD Process can help the BI Developers achieve these five things


1. Simply the deployment process: improve team productivity
2. Reduces manual work and errors: fewer bugs
3. Reduces deployment time: quick turnaround time
4. Ease of use and improved collaboration: teamwork
5. Automate the process and make it reusable: automation


>"Seamless CICD process reduces errors, deployment time and increases team collaboration"


By now, we understand the benefits of CICD, so let's look at the different ways; there are two approaches to implementing CICD in Power BI.


1. Power BI Service Deployment Pipelines ( within Power BI Service )
2. Azure DevOps and Power BI CICD using Service Principal ( with Azure DevOps )


In this article, I will cover the 1st Option within Power BI Service.

Without CICD, the BI creator has to publish the Dashboards manually in Dev, Test, and Prod. There are some difficulties in publishing a PowerBI Report directly from PowerBI Desktop, which includes


a.  The developer must be the admin or have access to the Workspace; otherwise, can't able to do any procedures.



b. PowerBI Desktop has to be connected to all the environments ( Dev, Test, and Prod ) to do the deployment which is not very safe

c. The developer needs to manually change the data source settings for every environment


## Power BI Deployment Pipelines is a simple five Step process


1. Create a deployment pipeline with DEV, QA, and PROD environments
2. Assign workspace to each environment
3. Develop and Publish the contents to the DEV workspace
4. Deploy it in the QA and PROD workspace with a click of a button
5. Share it with users through the Workspace or the App



## Detail Steps


### [Step 1] Create Deployment Pipeline

Go to [app.powerbi.com](https://app.powerbi.com/singleSignOn?clientSideAuth=0&ru=https:%2f%2fapp.powerbi.com%2f%3fclientSideAuth%3d0%26noSignUpCheck%3d1) and look for the rocket-like icon, click on the icon, it will open an option to create a pipeline, hit that button and it will prompt for the pipeline name, enter CICD Demo Pipeline, once you hit the create button it will present you three environments ( DEV, TEST, and PROD ) and an option to assign workspaces

![Power BI Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hro9zof9t2lvktoziyly.png)


![Power BI Dashboard with "create pipeline" highlighted](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bf8hw858hdv4bpxy57hj.png)


![Power BI Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1cn8296dc6jnhb5ob82x.png)

### [Step 2] Assign workspaces

Here we can see three environments ( DEV, TEST, and PROD ) and an option to assign workspaces; from the drop-down, give Development-Workspace to the DEV environment, QA to Test Environment, and PROD to the production environment. It should look something like this before and after the assignment.




![Before Assignment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oxqz9m88z0n900jl6kfo.png)


![After Assignment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d956fhx9e33jiloovh96.png)


### [Step 3] Develop and Publish Dashboard to Development Workspace

For this article, I will be using a sample dashboard from the Microsoft portal, the link to the portal is in the first comment

Since I am reusing an already developed Sales & Returns Dashboard, let's open it into Power BI Desktop and hit the publish button in the right corner, choose Development-workspace while deployment

![Sample Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/63qwcdw4i4g6sezoolsu.png)

### [Step 4] Deploy to (test) QA >> Deploy to Prod

After the development of the dashboard is done and it's published in a development environment, the Data Flow, Data Set, and Dashboard will visible in the Development environment to publish, hit the "Deploy to test" button in the Dev environment, the Power BI Deployment Pipeline will copy all the contents from Development to QA in a couple of seconds if not minutes

#### Ready for Test/Stage Deployment (empty QA and Prod Stages)


![Ready for Test Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gb00zt7nl4zk2gulu6cs.png)


![Stage Deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d69641xpzn7cb9y8ofol.png)

#### Hit the Deploy Button and the changes will be available in QA

The deployment might take a few seconds if not minutes based on the size of the reports, Do a round of testing and take the sign-off from QA and Customers, once done hit the "Deploy to Prod" button, and the contents will be copied to the Production workspace.


![Updated Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yhugaa587i7omubwyme1.png)



![Deployment Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s8zs3yxsv954p82rcnat.png)


### [Step 5] Share it with the users through App or through the workspace

Go to the workspace where the deployment is done ( In all three stages of the pipeline, a link to the workspace is available, navigate to the link and view the report



![Dashboard after deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/umszk9ldw9iwiuuohupc.png)



## Other Features

### Comparing stages

If there is any difference in DEV, test(Stage), or Production environment, that will be easily visible by an indicator in-between two stages, it does a comparison and then the indicator shows two states:

**Green indicator**: When the content item in both stages is exactly the same.

**Orange indicator**:  When the content from both stages appears different or if there is a difference in the number of items.



![Indicators in BI Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h41klafw03jwwr6q2060.png)


### Deployment History


![Deployment History Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8g8y2sjiojxg4a8chv8f.png)


A sequential, one-click release pipeline, with comparison and release history, is ready for your daily use, I hope you find this article informative and helpful to implement CICD in Power BI. Power BI Developers and Release managers let me know your thoughts on this article through comments

>""Deployment Pipeline, Camparison Tool, Deployment Histroy, 3 top features in five steps, what else do you need ??""


Yes, let me know what else you need, it can be a) how to trigger the pipelines automatically b) approval flow in the pipeline c) selective deployment. Let me know your wishlist in the comment section and I will cover that in the 2nd part of this Power BI Deployment Article series

Cheers

[Yogesh](https://www.linkedin.com/in/yogeshsdipankar/)!