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 to configure and deploy 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 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’.

Azure DevOps For Web Development - CD And Release Pipelines

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

Azure DevOps For Web Development - CD And Release Pipelines 

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

Azure DevOps For Web Development - CD And Release Pipelines 

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

Azure DevOps For Web Development - CD And Release Pipelines 

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.

Azure DevOps For Web Development - CD And Release Pipelines
 
Azure DevOps For Web Development - CD And Release Pipelines 

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

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

Azure DevOps For Web Development - CD And Release Pipelines 

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

Azure DevOps For Web Development - CD And Release Pipelines 

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

Azure DevOps For Web Development - CD And Release Pipelines 

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

Azure DevOps For Web Development - CD And Release Pipelines 

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

Azure DevOps For Web Development - CD And Release Pipelines 

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)

    Azure DevOps For Web Development - CD And Release Pipelines

  • The continuous integration build pipeline is triggered. (Covered in Part Three)

    Azure DevOps For Web Development - CD And Release Pipelines

    Azure DevOps For Web Development - CD And Release Pipelines

  • As soon as the build completes successfully, it triggers the continuous deployment pipeline.

    Azure DevOps For Web Development - CD And Release Pipelines

After some minutes, the deployment pipeline is complete .

Azure DevOps For Web Development - CD And Release Pipelines 

And the website is live!

Azure DevOps For Web Development - CD And Release Pipelines
 
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 which can enable you to ship more quickly, more frequently and with more confidence!

See also