DEV Community

Cover image for Part 4-Pipeline: "Mastering Release Pipelines & Blue-Green Approach"
Shrihari Haridass
Shrihari Haridass

Posted on

Part 4-Pipeline: "Mastering Release Pipelines & Blue-Green Approach"

As we delve into the second last part of our Azure Pipeline series, we're focusing on mastering Release Pipelines and embracing the Blue-Green deployment approach. If you have any queries, barriers, or doubts, don't hesitate to reach out on LinkedIn or drop a comment in the comment box. I'm here to answer your questions and guide you through the complexities. Join me in this journey through the fourth part, where we explore techniques to enhance deployment processes and implement efficient Blue-Green deployments. Your engagement and feedback are invaluable. Let's make the most out of Azure Pipelines together!

-> So today we will cover

A. Automating Deployment with multi-stage Release Pipelines

B. Continuous Deployment Triggers

C. Continuous delivery using deployment slots to enable blur-green deployment

D. Deployment gates such as query work items and approvals before the prod deployment

E. Pull request to test the entire CICD process with the build and release pipeline

=================================================================

*Note: *

When you are doing practical work, don't delete anything because our Azure DevOps series relies on continuity between each part. Ensure that you are not cleaning your workspace. Additionally, don't worry about charges, as our account is on a free trial. We are covering beginners or basic Azure DevOps, so our project is not large. If a bill is generated, it will not go higher. For some knowledge, you can budget or be ready to invest some money.

=================================================================

-> So, let's get started.

-> Navigate to the Azure DevOps portal, open our project labeled "Youtube Clone," and proceed to the "Pipeline" section. Within that, select "Release Pipeline." Currently, you may observe that there are no existing release pipelines.

Image description

-> Click on "New Pipeline." Note that this process differs from what we observed in the build pipeline. In this case, the options are presented within the GUI, and there is no provision for creating pipelines with YAML. Typically, organizations tend to use build pipelines more frequently, but the choice depends on specific requirements.

-> After clicking on "New Pipeline," select the first option, which is the "Azure App Service deployment" template. Provide a name for the pipeline.

Image description

Image description

-> Before deploying, we need an artifact, which is essentially the upstream build. Click on "Add an artifact," select "Source Type" as "Build," choose the pipeline, and click on "Add."

Image description

-> Now, if you look at the artifacts, there is a "Thunder Option" for the continuous trigger of the pipeline. Click on it and enable the trigger so that whenever a new build is available, it triggers the new pipeline. Add the branch as "default."

Image description

Image description

-> Now, in the stages, there are two conditions: "Pre-Deployment" and "Post-Deployment." Click on "Pre-Deployment" to configure.

Image description

-> Before proceeding, we need some inputs from boards. Go to Boards and create some work items and queries. I hope you have read my previous blogs.

Image description

-> Then go to "Queries," select "New Queries," and save it in "Shared Queries."

Image description

Image description

-> Now, go back to our pipeline. In this, we need "Artifacts Filters," which means specifying the branch to run on. In the "Gates" section, add gates for "Query Work Items."

Image description

-> And then go to "Shared Queries," where you will find our query. Set the "Upper Threshold" to 2.

Image description

-> After adding the "Jobs & tasks," click on "Run on Agent."

Image description

Image description

-> Then click on “Deployment Slots” in the Azure portal within our "Resource Group."

Image description

-> Then click on “Add Slot,” name it "Staging," clone settings from the main app, and click “Add.”

Image description

-> Now go back to our pipeline and click on “Save.”

Image description

-> till now we created the artifact stage and the test stage; now let's add one more stage for production. Click on “Clone” under “Stage.”

Image description

-> then click on the “pre-deployment” condition and add “pre-deployment approvals.”

Image description

-> Then go to the jobs, the only change is on “Run on Agent,” changing the slot to “Production.” For that, just uncheck the “Deploy Slot” option and save it.

Image description

=================================================================

Summary:

In the 4th part, we explored automating deployment with a multi-stage release pipeline in Azure DevOps. We covered continuous deployment triggers, continuous delivery using deployment slots for blue-green deployment, deployment gates with query work items, and approvals before production deployment. The focus was on setting up a release pipeline and integrating it with work items and queries for a streamlined CI/CD process.

=================================================================

If you have any doubts, questions, or recommendations, feel free to drop a comment. Follow me for updates and happy learning! :)

Top comments (0)