Mountain West Farm Bureau Insurance
office workers empowered by business technology solutions
BLOG
11
12
2020
12.18.2020

Are Multi-Stage YAML Pipelines in Azure DevOps Ready for Prime Time?

Microsoft recently announced that Multi-Stage YAML pipelines has gone GA (General Availability) and this has generated a lot of interest in YAML based pipelines replacing the UI based ones. The last time I looked at YAML pipelines, there were quite a few limitations for releases that kept us from fully switching over. Over the last few weeks, I did some live coding experiments on Twitch, performed a thorough comparison of features, and reviewed it with our teams to come to the conclusion that the Multi-Stages YAML pipelines are ready for prime time. You should start investigating and looking into the new features and additional functionality only available in the YAML pipelines.

Back in 2015, Microsoft updated the build system to the web based, cross platform system that is today. The build system is made up of two key parts. First is builds that performs activities that compile, verify quality of the code, and package the application into an artifact so it is ready to deploy and release. The two common types of builds that are performed here are PR builds and CI builds. Releases manage the orchestration of artifacts throughout the environment performing activities such as deployments, automated testing, approval gates, and more. Microsoft has renamed these builds to Classic UI builds.

A Multi-Stage YAML Pipeline represents the entire pipeline from CI to the deployments to each environment as a YAML code file. The YAML file essentially replaces what both the Builds and Releases accomplishes. This is built on the same platform as the Classic UI builds and releases.

YAML pipeline

Here is a simplified representation of what a multi-stage YAML Pipeline looks like. Any time you are using code versus an editor, there will be a learning curve. YAML is no different. It is a simple syntax of key value pairs similar to JSON but YAML uses indention instead of brackets.

trigger:

- master

stages:

- stage: CI

jobs:
  - job: Build and Package App
steps:
  - checkout
- Install Node.js
- npm install and build
- publish artifact

- stage: DEV

jobs:
  - deployment: Deploy Web App
    environment: Dev environment
    steps:
     - Provision Web App Infrastructure
     - Deploy Web App

-stage: PROD

jobs:
  - deployment: Deploy Web App
    environment: Prod environment
   steps:
     - Provision Web App Infrastructure
     - Deploy Web App

When authoring YAML pipelines you do get some assistance. Editing in the web and using the Azure Pipelines extension in VSCode provide intellisense and display error indicators if indenting or syntax isn't correct. In addition, when adding tasks as steps, you can use the assistant to find the desired task and help set the appropriate values.

YAML markup for Azure Web App

I went through all of the typical activities we perform builds and releases and made sure they were all able to be accomplished with YAML pipelines. All of these activities are available or equivalent functionality is available. Only one feature didn't have a good alternative in YAML pipelines is deployment gates. If you are using these, you probably will want to still with the releases for now or handle it with custom decorators. There are a few older technologies like TFVC and Subversion that are not supported. This link provides a nice feature comparison list.

YAML pipelines offer some advantages over the classic UI builds and releases. First, the YAML file is code and lives with the application code so when you branch your code, you branch your YAML pipeline file. This allows you to modify the build in your branch without affecting other branches. Also, with smaller applications and microservices able to be deployed independently, the overhead of having a PR, CI, and Release for each deployable because harder to manage. There's also a few new features in YAML pipelines that make them more compelling. Features like templates for making pipelines and utilizing environments to separate compliance and approvals from the pipelines.

If you haven't started looking into YAML pipelines, now that it is GA and at feature parity with classic UI pipelines, it is a great time to start. Microsoft Learn has several nice hands on labs for getting started. Microsoft Learn - Create a multistage pipeline by using Azure Pipelines.

Recent Blog Posts

lunavi logo alternate white and yellow
4.20.2021
04
.
20
.
2021
Building Your Cloud Foundation Part 1: Core Configuration & Governance

This first area of focus establishes your cloud policy, or the way your organization consumes and manages cloud resources. Learn how to establish proper scope and mitigate tangible risks through corporate policy and standards.

Learn more
lunavi logo alternate white and yellow
2.25.2021
02
.
25
.
2021
Lunavi Proves Commitment to Channel Partners, Customers with CRN Elite 150

While industry recognition such as the MSP 501 is validating, the most rewarding part of my work in the channel is hearing from partners and their clients about the success they have with these types of engagements.

Learn more
lunavi logo alternate white and yellow
1.21.2021
01
.
20
.
2021
More Than Just Another Partnership, the Azure Expert MSP Is a Unique Source of Pride

As a founder and leader at Lunavi, I’ve seen our organization achieve a lot of big things. That said, achieving the distinction of Azure Expert MSP stands out.

Learn more