Azure DevOps For Web Development - CD And Release Pipelines

Scope

This article is part of a series of 4 articles on getting an ASP.NET web app live on Azure App Services using Azure Repos and Azure Pipelines. The previous articles described how to create your Azure DevOps account, create a project, and push your code to Azure Repos using Git.

This fourth & last article of the series will walk you through automating deployments each time a new build is available.

Continuous Delivery (CD)

Continuous Delivery (CD) is the process of configuring and deploying from a build to a production environment. By automation, CD minimizes the time to deploy and time to remediate production incidents.

Azure Pipelines is the Continuous Integration / Continuous Delivery service in Azure DevOps that can build any language targeting any platform and deploy it to any cloud provider.

Release Pipeline

The final part of this article is about taking the artifact from the build pipeline each time a build is completed and automatically deploying it to Azure App Service. Go to ‘Releases’ under ‘Pipelines’ in the navigation bar.

Click on ‘New Pipeline’.

New Pipeline

You will be presented with a variety of readymade deployment templates. Choose Azure App Service Deployment for this example.

 Deployment templates

On the next screen, click on ‘Add an Artifact’

Artifact

Choose the project then the build pipeline you previously made. The artifact is automatically detected.

 Pipeline

After choosing the artifact, click on the little lighting icon and enable Continuous Deployment for a release to be created each time a new build is available.

Continuous Deployment

Stage

Next, configure the task for the deployment stage. Click on the stage.

On the task configuration page, authorize your Azure subscription, then select which resource we want to deploy the web app and click save.

 Azure subscription

At this point, you have completed a simple release pipeline for our example.

Task

But in more realistic scenarios, we want more elaborate release management, with staging & deployment stages, for example.

 Realistic scenarios

Different stages can deploy to different deployment slots in an Azure App Service, this can be configured in the staging task.

 Azure App Service

Pre-deployment & Post-Deployment can also be configured, so selected users can approve deployment to the next stage by clicking on the person.

Post-Deployment

Now that CD is set up, the full CI/CD solution built throughout the 4 articles can be tested. Here’s a workflow for demo purposes, starting with a blank Azure App service which is up and running.

Azure DevOps For Web Development - CD And Release Pipelines

  • Make some changes to the code and push commits. (Covered in Part Two).
    Push commits
  • The continuous integration build pipeline is triggered. (Covered in Part Three).
    Triggered
    Agent Job
  • As soon as the build completes successfully, it triggers the continuous deployment pipeline.
    DevOps

After some minutes, the deployment pipeline is complete.

Succeeded

And the website is live

Website

Conclusion

The 4 articles of this Azure DevOps for Web Development Series, walked you through the basics of using Azure DevOps. It is a powerful and extensible tool that can enable you to ship more quickly, more frequently, and with more confidence.

See also


Similar Articles