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’.
You will be presented with a variety of readymade deployment templates. Choose Azure App Service Deployment for this example.
On the next screen, click on ‘Add an Artifact’
Choose the project then the build pipeline you previously made. The artifact is automatically detected.
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.
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.
At this point, you have completed a simple release pipeline for our example.
But in more realistic scenarios, we want more elaborate release management, with staging & deployment stages, for example.
Different stages can deploy to different deployment slots in an Azure App Service, this can be configured in the staging task.
Pre-deployment & Post-Deployment can also be configured, so selected users can approve deployment to the next stage by clicking on the person.
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.
- Make some changes to the code and push commits. (Covered in Part Two).
- The continuous integration build pipeline is triggered. (Covered in Part Three).
- As soon as the build completes successfully, it triggers the continuous deployment pipeline.
After some minutes, the deployment pipeline is complete.
And the website is live
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