Reader small image

You're reading from  Azure DevOps Explained

Product typeBook
Published inDec 2020
PublisherPackt
ISBN-139781800563513
Edition1st Edition
Tools
Concepts
Right arrow
Authors (3):
Sjoukje Zaal
Sjoukje Zaal
author image
Sjoukje Zaal

Sjoukje Zaal is head of the Microsoft Cloud Center of Excellence, Microsoft Regional Director, and Microsoft Azure MVP with over 20 years' experience in architecture, development, consultancy, and design-related roles. She currently works at Capgemini, a global leader in consultancy, technology services, and digital transformation. She loves to share her knowledge and is active in the Microsoft community as a co-founder of the user groups Tech Daily Chronicle, Global XR Community, and the Mixed Reality User Group. She is also a board member of Azure Thursdays and Global Azure. Sjoukje is an international speaker and is involved in organizing many events. She has written several books and writes blogs.
Read more about Sjoukje Zaal

Stefano Demiliani
Stefano Demiliani
author image
Stefano Demiliani

Stefano Demiliani is a Microsoft MVP on Business Applications and Azure, MCT, Microsoft Certified Solution Developer (MCSD), Azure Certified Architect, and an expert in other Microsoft related technologies. His main activity is architecting and developing enterprise solutions based on the entire stack of Microsoft technologies (mainly focused on ERP and serverless applications). He has worked with Packt Publishing on many IT books related to Azure cloud applications and Dynamics 365 Business Central and is a frequent speaker at IT conferences around Europe. In his free time Stefano is also a runner and a cyclist.
Read more about Stefano Demiliani

Amit Malik
Amit Malik
author image
Amit Malik

Amit Malik is an IT enthusiast and technology evangelist from Delhi, India. He specializes in Virtualization, Cloud, and emerging technology space. He has an intense knowledge in building cloud solutions with Microsoft Windows Azure Pack. Amit holds various industry admired certifications from all major OEM's in Virtualization and Cloud space including MCSE for Private Cloud. Amit has designed and built numerous virtualization and private cloud solutions comprising the product lines of Microsoft, VMware, and Citrix. Apart from these, he can be found working on emerging technologies including VDI, hyper convergence, Software Defined Infrastructure solutions including networking and storage, Containers, Big Data, IoT, and other similar technologies. Amit is interested in building products and doing product management in near future for related technology space. You can always reach Amit on LinkedIn (https://in.linkedin.com/in/amitmalik99)or email (contact2amitmalik@gmail.com)
Read more about Amit Malik

View More author details
Right arrow

Chapter 8: Deploying Applications with Azure DevOps

In previous chapters, we saw how you can automate your development processes by using build pipelines for your code. But an important part of the software life cycle is also the release phase. In this chapter, we will cover an overview of release pipelines; we'll see how to create a release pipeline with Azure DevOps and how you can automate and improve the deployment of your solutions by using release approvals and multi-stage pipelines.

We will cover the following topics in this chapter:

  • An overview of release pipelines
  • Creating a release pipeline with Azure DevOps
  • Configuring continuous deployment on a release pipeline
  • Creating a multi-stage release pipeline
  • Using approvals and gates for controlling your release process
  • Using environments and deployment groups
  • Using YAML-based pipelines for release

Technical requirements

To follow this chapter, you need to have an active Azure DevOps organization. The organization used in this chapter is the PartsUnlimited organization we created in Chapter 1, Azure DevOps Overview.

An overview of release pipelines

Release pipelines permit you to implement the continuous delivery phase of a software life cycle. With a release pipeline, you can automate the process of testing and deliver your solutions (committed code) to the final environments or directly to the customer's site (continuous delivery and continuous deployment).

With continuous delivery, you deliver code to a certain environment for testing or quality control, while continuous deployment is the phase where you release code to a final production environment.

A release pipeline can be triggered manually (you decide when you want to deploy your code) or it can be triggered according to events such as a code commit on the master branch, after the completion of a stage (for example, the production testing stage), or according to a schedule.

A release pipeline is normally connected to an artifact store (a deployable component for an application and output of a build). An artifact store contains...

Creating a release pipeline with Azure DevOps

The final goal for implementing a complete CI/CD process with DevOps is to automate the deployment of your software to a final environment (for example, the final customer), and to achieve this goal, you need to create a release pipeline.

A release pipeline takes the build artifacts (the result of your build process) and deploys those artifacts to one or more final environments.

To create our first release pipeline, we'll use the PartsUnlimited web application project previously deployed on Azure DevOps:

  1. To create a release pipeline with Azure DevOps, click on Pipelines on the left menu, select Releases, and then click on New release pipeline:

    Figure 8.2 – Creating a new release pipeline

  2. In the Select a template list that appears on the right, you have a set of available templates for creating releases for different types of applications and platforms. For our application, select Azure App Service deployment...

Creating a multi-stage release pipeline

A multi-stage release pipeline is useful when you want to release your applications with multiple steps (staging), such as, for example, development, staging, and production. A quite common scenario in the real world is, for example, deploying an application initially to a testing environment. When tests are finished, the application is moved to a quality acceptance stage, and then, if the customer accepts the release, the application is moved to a production environment.

Here, we'll do the same: starting from the previously created single-stage pipeline, we'll create a new release pipeline with three stages, called DEV, QA, and Production. Each stage is a deployment target for our pipeline:

  1. In the previously defined pipeline, as a first step, I renamed the Deploy to cloud stage to Production. This will be the final stage of the release pipeline.
  2. Now, click on the Clone action to clone the defined stage into a new stage...

Using approvals and gates for managing deployments

As previously configured, our release pipeline will move between stages only if the previous stage is completed successfully. This is okay for moving from DEV to QA because on this transition, our application is deployed to a testing environment, but the transition from QA to Production should usually be controlled because the release of an application into a production environment normally occurs after an approval.

Creating approvals

Let's follow these steps to create approvals:

  1. To create an approval step, from our pipeline definition, select the Pre-deployment conditions properties of the Production stage. Here, go to the Pre-deployment approvals section and enable it. Then, in the Approvers section, select the users that will be responsible for approving. Please also check that the The user requesting a release or deployment should not approve it option is not ticked:

    Figure 8.26 – Setting approvals

  2. ...

YAML release pipelines with Azure DevOps

A recently added feature of Azure DevOps is the option to define release pipelines by using YAML (previously, this was possible only for the CI part). This is now possible by using multi-stage pipelines and with that, you can use a unified YAML experience for configuring Azure DevOps pipelines for CI, CD, and CI/CD.

Defining the release YAML pipeline can be done exactly as described in Chapter 4, Understanding Azure DevOps Pipelines. There are, however, some concepts to understand, such as environments.

Environments are a group of resources targeted by a pipeline – for example, Azure Web Apps, virtual machines, or Kubernetes clusters. You can use environments to group resources by scope – for example, you can create an environment called development with your development resources and an environment called production with the production resources. Environments can be created by going to the Environments section under Pipelines...

Summary

In this chapter, we had a full overview of how to work with release pipelines in Azure DevOps.

We created a basic release pipeline for the PartsUnlimited project, defined artifacts, and created our first release by adding continuous deployment conditions.

Then, we improved our pipeline definition by using multiple stages (DEV, QA, and Production), and at the end of this chapter, we saw how to define approvals and gates for managing the release of our code in a more controlled way and the concepts around YAML-based release pipelines

In the next chapter, we'll see how to integrate Azure DevOps with GitHub.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Azure DevOps Explained
Published in: Dec 2020Publisher: PacktISBN-13: 9781800563513
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (3)

author image
Sjoukje Zaal

Sjoukje Zaal is head of the Microsoft Cloud Center of Excellence, Microsoft Regional Director, and Microsoft Azure MVP with over 20 years' experience in architecture, development, consultancy, and design-related roles. She currently works at Capgemini, a global leader in consultancy, technology services, and digital transformation. She loves to share her knowledge and is active in the Microsoft community as a co-founder of the user groups Tech Daily Chronicle, Global XR Community, and the Mixed Reality User Group. She is also a board member of Azure Thursdays and Global Azure. Sjoukje is an international speaker and is involved in organizing many events. She has written several books and writes blogs.
Read more about Sjoukje Zaal

author image
Stefano Demiliani

Stefano Demiliani is a Microsoft MVP on Business Applications and Azure, MCT, Microsoft Certified Solution Developer (MCSD), Azure Certified Architect, and an expert in other Microsoft related technologies. His main activity is architecting and developing enterprise solutions based on the entire stack of Microsoft technologies (mainly focused on ERP and serverless applications). He has worked with Packt Publishing on many IT books related to Azure cloud applications and Dynamics 365 Business Central and is a frequent speaker at IT conferences around Europe. In his free time Stefano is also a runner and a cyclist.
Read more about Stefano Demiliani

author image
Amit Malik

Amit Malik is an IT enthusiast and technology evangelist from Delhi, India. He specializes in Virtualization, Cloud, and emerging technology space. He has an intense knowledge in building cloud solutions with Microsoft Windows Azure Pack. Amit holds various industry admired certifications from all major OEM's in Virtualization and Cloud space including MCSE for Private Cloud. Amit has designed and built numerous virtualization and private cloud solutions comprising the product lines of Microsoft, VMware, and Citrix. Apart from these, he can be found working on emerging technologies including VDI, hyper convergence, Software Defined Infrastructure solutions including networking and storage, Containers, Big Data, IoT, and other similar technologies. Amit is interested in building products and doing product management in near future for related technology space. You can always reach Amit on LinkedIn (https://in.linkedin.com/in/amitmalik99)or email (contact2amitmalik@gmail.com)
Read more about Amit Malik