Azure Pipelines supports automating builds and deployments. A classic pipeline is built using a visual, point-and-click designer in the Azure DevOps portal. In contrast, a YAML pipeline is defined by a code file (a YAML file) stored directly in your application's source code repository. Migrating to YAML makes your pipeline definition modular, easier to reproduce, and trackable through version control, just like your application code.
The migration from a classic to a YAML pipeline follows a structured process. First, you must analyze your existing classic pipeline to identify all its key components, such as the specific build or deployment tasks it runs, any variables it uses, and the triggers that cause it to start. Next, you map each of these elements to its equivalent YAML syntax. For example, a task in the classic designer becomes a task: block in YAML, and a variable becomes a variables: entry.
When mapping tasks, you must pay attention to the correct task version. Each task, like the AzureFunctionApp task used to deploy a function, has specific versions (e.g., @1 or @2). You need to choose the version that matches the functionality you used in the classic pipeline and ensure your YAML syntax includes this version number. Using the wrong version can lead to errors or missing features in your new pipeline.
After mapping, you author the complete YAML configuration file. This file should be placed in your repository, typically in a folder like .azuredevops. The goal is to create a modular definition where each stage, job, and step is clearly organized. You then validate the new pipeline by running it. A successful run that produces the same outcome as your classic pipeline confirms that the migration maintains functional parity.
Seeking the thrill of transformative tech? Explore the art of designing and implementing DevOps solutions on Azure. Master the shift towards CI/CD, testing, and delivery, while preparing for the Designing and Implementing Microsoft DevOps Solutions exam!
Prepare and test your skills

Prepare and test your skills

A classic pipeline is built using a visual, point-and-click designer in the Azure DevOps portal, while a YAML pipeline is defined by a YAML code file stored directly in your application's source code repository. Migrating to YAML makes your pipeline definition modular, easier to reproduce, and trackable through version control.
The first step is to analyze your existing classic pipeline to identify all its key components, such as specific build or deployment tasks, variables, and triggers. You then map each of these elements to its equivalent YAML syntax.
Using the wrong task version can lead to errors or missing features in your new pipeline. You must choose the version, like @1 or @2, that matches the functionality you used in the classic pipeline and ensure your YAML syntax includes this version number.