AZ-400 Question 216
Select 2You have a classic build pipeline in Azure DevOps that runs on merges to the main branch, uses multiple phases, and references variable groups for configuration. Your team wants to migrate this pipeline to a YAML-based pipeline while preserving all tasks, triggers, and environment variables. Which two actions should you perform to successfully complete this migration?
- A
Use the Azure DevOps CLI command az pipelines convert --name
to generate a complete YAML pipeline file from the existing classic pipeline. - B
For each phase or job in the classic pipeline, choose 'View YAML' (where available) to export the tasks, then manually merge these sections into a new YAML pipeline file.
- C
Recreate your triggers, variable groups, and other configuration details in the newly created YAML pipeline, ensuring they match the original classic pipeline settings.
- D
Delete the classic pipeline in the Azure DevOps portal before creating any new YAML pipelines to avoid conflicts.
Show answer and explanation
Correct answers: B, C
Explanation
Azure DevOps does not provide a single-click migration tool that seamlessly converts a classic pipeline into a YAML pipeline. Instead, administrators typically export each task� or phase� YAML definition, merge these snippets into a new YAML pipeline file, and then manually configure triggers and variable groups. Microsoft� documentation recommends maintaining the original pipeline until the YAML pipeline is fully tested. Refer to official Azure DevOps documentation on 'Migrating from Classic Pipelines to YAML Pipelines' for step-by-step guidance.
- A. Incorrect.
Incorrect. There is no built-in Azure DevOps CLI command called az pipelines convert that fully automates the migration from classic to YAML. Azure DevOps provides guidance on exporting tasks and creating manual YAML configurations rather than a direct one-step conversion.
- B. Correct.
Correct. When migrating from classic pipelines, you can select 'View YAML' (for compatible tasks) to see the YAML definition of each job or task. You then copy these snippets into a main YAML file and refine them as needed.
- C. Correct.
Correct. Triggers and variable groups do not automatically transfer from the classic pipeline definition. You must manually add or reference them in your YAML file to ensure behavior remains consistent with the original classic pipeline.
- D. Incorrect.
Incorrect. You do not need to delete your classic pipeline prior to creating a new YAML pipeline. In fact, it� a best practice to keep the classic pipeline until you verify that the YAML pipeline works correctly. You can then remove the classic pipeline afterward, if desired.