AZ-400 exam dumps

AZ-400 practice question 144 of 306

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

AZ-400 Question 144

Select 2

You need to configure an Azure DevOps multi-stage pipeline with four stages: Build, UnitTests, IntegrationTests, and Deploy. The Build stage compiles and prepares the application. The UnitTests stage runs unit tests, and the IntegrationTests stage runs integration tests. Both testing stages should wait until the Build stage completes, but they can run in parallel with each other. Finally, the Deploy stage should only run if both test stages have passed successfully. Which two actions should you take to meet these requirements?

  1. A

    A. Configure both UnitTests and IntegrationTests stages to directly depend on the Build stage, and remove any dependency between the test stages themselves.

  2. B

    B. Set a post-build task in the Build stage to trigger the Deploy stage if the Build succeeds, bypassing the test stages entirely.

  3. C

    C. Define each test stage in separate jobs that both depend on the Build stage, ensuring they can execute in parallel but still require Build completion.

  4. D

    D. Configure the Deploy stage to depend on both the UnitTests and IntegrationTests stages, and use conditions to ensure it only runs if both tests succeed.

Show answer and explanation

Correct answers: A, C

Explanation

In Azure DevOps, multi-stage pipelines use 'dependsOn' to define a job or stage dependency and can run jobs in parallel when they don�t directly depend on each other. By configuring the UnitTests and IntegrationTests stages to depend on the Build stage (Option A) and defining them as separate jobs (Option C), you enforce the required Build completion before tests and allow tests to run concurrently. Finally, Deploy should depend on both test stages and only proceed if they succeed. For more information, refer to Microsoft� documentation on Azure Pipelines multi-stage YAML syntax and job dependencies: https://docs.microsoft.com/azure/devops/pipelines/process/stages.

  • A. Correct.

    Option A is Correct. By configuring both testing stages to depend on the Build stage, you ensure they do not start until Build successfully completes. Removing direct dependencies between the test stages allows them to run in parallel.

  • B. Incorrect.

    Option B is Incorrect. Triggering Deploy after only a successful Build bypasses essential validations from the test stages, violating the requirement that Deploy should only occur after successful tests.

  • C. Correct.

    Option C is Correct. Defining each test stage in separate jobs with dependencies on Build allows parallel execution while ensuring the Build completion is a prerequisite for both. This is a common approach in multi-stage YAML pipelines using job-level dependencies.

  • D. Incorrect.

    Option D is Incorrect. While it is correct that Deploy should depend on passing tests, you don�t rely solely on conditions. You should also specify job dependencies for Deploy to only start after both test stages are done. This option alone does not fully address the need to ensure parallel test execution with proper ordering.

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