nerdexam
Microsoft

AZ-400 · Question #599

Hotspot Question You have an Azure DevOps organization that contains a build job. The job is configured by using a pipeline named Pipeline1. You need to run the job on multiple operating system images

The correct answer is First YAML key selection: strategy:; Second YAML key selection: matrix:. This question tests knowledge of Azure DevOps YAML pipeline configuration for running jobs across multiple operating system images using a matrix strategy.

Submitted by yasin.bd· Mar 6, 2026Design and implement build and release pipelines

Question

Hotspot Question You have an Azure DevOps organization that contains a build job. The job is configured by using a pipeline named Pipeline1. You need to run the job on multiple operating system images. How should you complete the YAML code for Pipeline1? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point. Answer:

Exhibit

AZ-400 question #599 exhibit

Answer Area

  • First YAML key selectionstrategy:
    container:deployment:matrix:strategy:uses:
  • Second YAML key selectionmatrix:
    container:deployment:matrix:strategy:uses:

Explanation

This question tests knowledge of Azure DevOps YAML pipeline configuration for running jobs across multiple operating system images using a matrix strategy.

Approach. To run a job on multiple OS images in Azure DevOps YAML pipelines, you use the 'strategy' keyword with 'matrix' to define multiple configurations, and 'vmImage' under 'pool' to reference the matrix variable. The correct structure uses 'strategy: matrix:' to define named configurations (e.g., linux, windows, mac) each with an 'imageName' variable, then sets 'pool: vmImage: $(imageName)' to dynamically select the image. The YAML should look like: 'strategy: matrix: linux: imageName: ubuntu-latest windows: imageName: windows-latest' and 'pool: vmImage: $(imageName)'. This causes Azure DevOps to spin up parallel jobs for each matrix entry, each running on the specified OS image.

Concept tested. Azure DevOps YAML pipeline matrix strategy for multi-platform job execution using 'strategy: matrix' combined with dynamic 'pool: vmImage' variable references to run the same job across multiple operating system images simultaneously.

Reference. https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops#matrix

Topics

#YAML pipeline#matrix strategy#multi-OS builds#Azure Pipelines

Community Discussion

No community discussion yet for this question.

Full AZ-400 Practice