AZ-400 exam dumps

AZ-400 practice question 142 of 306

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

AZ-400 Question 142

Select 2

You maintain an Azure DevOps YAML pipeline for a microservices application. The pipeline is divided into four jobs: Build, SecurityScan, IntegrationTest, and Package. The SecurityScan job relies on the build artifacts, while the IntegrationTest job can begin as soon as the Build job is complete, even if SecurityScan has not finished. However, the Package job must only run after both SecurityScan and IntegrationTest finish successfully. Which two design choices should you implement within the pipeline YAML to satisfy these requirements?

  1. A

    A. Specify 'dependsOn: Build' for both SecurityScan and IntegrationTest, and specify 'dependsOn: [SecurityScan, IntegrationTest]' for Package.

  2. B

    B. Place all tasks in a single job with the same 'dependsOn' property set to 'Build'.

  3. C

    C. Split each job into separate pipelines and link them using release triggers.

  4. D

    D. Use job-level dependencies so that SecurityScan and IntegrationTest are parallel, but Package depends on both SecurityScan and IntegrationTest.

Show answer and explanation

Correct answers: A, D

Explanation

In Azure DevOps YAML pipelines, you can configure parallel jobs by setting the 'dependsOn' property. Jobs with the same dependency start running as soon as their prerequisite job completes. To ensure a particular job runs only after multiple other jobs succeed, list all the jobs it depends on. For more detailed guidance, refer to Microsoft's official documentation on designing multi-stage YAML pipelines and job dependencies: https://docs.microsoft.com/azure/devops/pipelines/process/multi-stage-pipelines.

  • A. Correct.

    A. Correct. Setting 'dependsOn: Build' for SecurityScan and IntegrationTest ensures they both wait for the Build job to complete. Then, specifying 'dependsOn: [SecurityScan, IntegrationTest]' for Package forces it to wait until both prerequisites have finished, enabling proper parallelism and sequencing.

  • B. Incorrect.

    B. Incorrect. Placing everything in a single job does not allow concurrent execution of SecurityScan and IntegrationTest, defeating the purpose of parallelism.

  • C. Incorrect.

    C. Incorrect. While splitting tasks into multiple pipelines can work, it often adds unnecessary complexity for straightforward parallel job requirements within a single pipeline. This approach is more appropriate for complex organizational or security separation needs, not simple parallel execution.

  • D. Correct.

    D. Correct. Azure DevOps YAML supports job dependencies, allowing multiple jobs to run in parallel if they share the same parent dependency (Build). Package can then be configured to depend on both SecurityScan and IntegrationTest, ensuring it only runs after both complete.

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