Migrating Classic Pipelines to YAML
This lesson explains why to migrate, what can be exported, and how classic features map to YAML.
Learning outcomes
After completing this lesson, you will be able to:
- Explain the benefits of YAML.
- Migrate a classic build pipeline.
- Map classic release concepts to YAML.
- Identify differences that affect a migration.
Why migrate
Classic build and release pipelines are defined through a visual interface, and they are stored in Azure DevOps. They work, but the definition is separate from the code. A YAML pipeline lives in the repository, so it gains pull request review, branch-specific changes, and a history that matches the code it builds. Templates enable reuse, and new platform features tend to reach YAML. Microsoft recommends YAML for new pipelines, and organizations can turn off the creation of new classic pipelines through settings.
Migrating a classic build pipeline
Classic build pipelines can be exported directly. Open the pipeline definition, not a run, select the menu with three dots, and choose Export to YAML. The file is a starting point, and it usually needs editing, since some settings do not carry across.
-
Export
Download the YAML from the pipeline definition.
-
Add to the repository
Commit the file on a branch.
-
Create a YAML pipeline
Point a new pipeline at the file.
-
Move settings
Recreate triggers, variables and agent settings.
-
Run side by side
Compare outputs with the classic pipeline.
-
Disable the classic pipeline
Keep it disabled for a time, then delete it.
Migrating a classic build
Migrating a classic release pipeline
Classic release pipelines have no YAML export. Each task can be viewed as YAML from the task panel, but the structure must be rebuilt by hand. This is where most migration effort lies. The mapping of concepts is shown in the following table.
| Classic release concept | YAML equivalent |
|---|---|
| Release pipeline | Multi-stage YAML pipeline |
| Stage | stage with a deployment job |
| Pre-deployment approvals | Approvals check on an environment |
| Release gates | Environment checks, such as Query Azure Monitor Alerts |
| Artifact sources | Pipeline artifacts and pipeline resources |
| Continuous deployment trigger | trigger, or a pipeline resource trigger |
| Deployment groups | VM resources in an environment |
| Task groups | Step templates |
| Variable scoped to a stage | Variables at stage level |
| Release retention | Retention leases and project settings |
Gates and approvals need careful thought, as they move from the definition of the pipeline to the environment. This actually improves control, since they then apply to all pipelines that use an environment, and cannot be edited by someone who edits only the YAML.
The following diagram maps each classic pipeline item to its YAML replacement.

Classic release concepts in YAML
Differences that catch people out
- Schedules: YAML schedules use UTC by default, whereas classic pipelines use the organization's local time zone. A nightly build can appear to move after migration.
- Checkout: a deployment job does not check out source code automatically, unlike a classic build.
- Variables: secret variables in pipeline settings can be kept, but they should move to variable groups or Key Vault.
- Triggers: a YAML pipeline with no trigger section runs for all branches.
- Permissions: pipelines must be authorized to use service connections, agent pools and environments.
- Branch behaviour: because the YAML is in the repository, each branch can have a different definition.
Surprises after migration
Moving to GitHub Actions
Some organizations migrate further, from Azure Pipelines to GitHub Actions. GitHub Actions Importer audits existing pipelines, forecasts usage and generates draft workflows. Azure Pipelines YAML and classic pipelines are among its supported sources. As with any automated conversion, the output needs review, particularly for service connections, which become federated credentials, and for checks, which become environment protection rules.
Planning a migration
A company has 40 classic build pipelines and 25 classic release pipelines. Each release pipeline uses pre-deployment approvals and an Azure Monitor gate. A nightly build runs at 01:00 in Sydney. What should the migration plan state?
Export the build pipelines with Export to YAML and tidy the output. Rebuild the release pipelines as multi-stage YAML, because there is no release export, moving approvals and gates to environment checks. Convert the nightly schedule to UTC, as YAML cron times are in UTC by default. Moving everything with an automatic export is not possible for the release pipelines, and copying approvals into YAML steps would give up the protection of checks.
What replaces a classic deployment group in YAML?
Show answer
VM resources in an environment, which use an agent installed on each machine.
Exam Tips
Remember for the exam
- Export to YAML works for classic build pipelines only.
- Classic release pipelines must be rebuilt as multi-stage YAML.
- Pre-deployment approvals and gates become environment checks.
- Task groups become step templates; deployment groups become VM resources.
- YAML schedules use UTC by default.