AZ-400 exam dumps

AZ-400 practice question 143 of 306

Designing and Implementing Microsoft DevOps Solutions. Professional level, Microsoft. Free question with the correct answer and a full explanation.

AZ-400 Question 143

Select 2

You are configuring a multi-stage Azure DevOps YAML pipeline for a web application. The pipeline has four stages: Build, IntegrationTests, UITests, and Deploy. The Build stage must always complete before any tests are executed. The IntegrationTests and UITests stages should run in parallel and only depend on the Build stage. Finally, the Deploy stage should run after both test stages have successfully completed. Which two actions should you implement to meet these requirements?

  1. A

    Use 'dependsOn' to configure IntegrationTests and UITests to depend on Build, and Deploy to depend on both test stages.

  2. B

    Place IntegrationTests and UITests in the same job but separate tasks so they can automatically run in parallel by default.

  3. C

    Enable the 'parallel' keyword at the stage level for IntegrationTests and UITests while ensuring each stage references 'dependsOn: Build.'

  4. D

    Set Deploy to only depend on Build, then include conditions within the Deploy stage to check if IntegrationTests and UITests succeeded.

Show answer and explanation

Correct answers: A, C

Explanation

Stages in Azure DevOps YAML pipelines rely on the 'dependsOn' keyword to define their execution sequence. To run multiple stages in parallel, point them to the same stage in their 'dependsOn' section, so they begin after that dependency finishes. To ensure a final stage (like Deploy) waits for both parallel stages to complete successfully, specify that final stage� dependencies accordingly. For more details, refer to Microsoft� official YAML pipelines documentation on defining stage dependencies and parallel job execution.

  • A. Correct.

    Correct: By explicitly specifying 'dependsOn' for IntegrationTests and UITests as 'Build,' both stages can start after a successful Build. Then, setting 'dependsOn' for Deploy to require both test stages ensures it only runs once both tests complete.

  • B. Incorrect.

    Incorrect: Although placing multiple tasks in one job can allow them to run in parallel, the question specifically requires separate stages for IntegrationTests and UITests. Merely separating tasks in a single job does not address the stage-level dependency on Build.

  • C. Correct.

    Correct: Enabling parallel execution at the stage level (for instance using the 'strategy: parallel' syntax or separate stages pointing to 'dependsOn: Build') ensures IntegrationTests and UITests run concurrently, both branching off from the Build stage.

  • D. Incorrect.

    Incorrect: If Deploy only depends on Build, it can start prematurely without ensuring the tests have completed. Using a condition within Deploy to check test outcomes does not reliably enforce the correct order for stage execution.

Timed practice exam

Take a AZ-400 practice test under exam conditions

70 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam