Microsoft DevOps Engineer Expert AZ-400 Practice Question
You are defining an Azure Pipelines YAML stage that contains three jobs:
UnitTests
ApiTests
PublishArtifacts The two test jobs must run concurrently to shorten execution time. The PublishArtifacts job must start only after both tests have finished successfully, and you do not want to serialize the test jobs or move them to a different stage. Which YAML configuration should you add to the PublishArtifacts job to meet these requirements?
Add the line dependsOn: [UnitTests, ApiTests] to the PublishArtifacts job and leave the two test jobs without dependencies.
Set strategy: parallel with maxParallel: 2 at the stage level to control job concurrency and ordering.
Add the line condition: succeeded() to the PublishArtifacts job and omit the dependsOn property.
Move PublishArtifacts to its own stage and set a stage-level dependsOn for the test stage.
In Azure Pipelines, jobs within the same stage run in parallel by default unless an explicit dependency is declared with dependsOn. Adding dependsOn: [UnitTests, ApiTests] to the PublishArtifacts job correctly configures the pipeline to wait for both UnitTests and ApiTests to complete successfully before starting. Since the two test jobs have no dependencies on each other, they will execute concurrently. Using only a condition statement does not establish an execution order; the job would still attempt to run in parallel with the others. The strategy: parallel property is set on a job, not a stage, and is used to run multiple instances of that single job, not to coordinate different jobs. Moving PublishArtifacts to a separate stage would work but is explicitly forbidden by the question's constraints.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `dependsOn` property do in Azure Pipelines YAML?
Open an interactive chat with Bash
How do jobs within the same stage execute by default in Azure Pipelines?
Open an interactive chat with Bash
What is the purpose of the `strategy: parallel` property in Azure Pipelines YAML?
Open an interactive chat with Bash
What does 'dependsOn' do in Azure Pipelines YAML?
Open an interactive chat with Bash
Why do jobs run in parallel by default in Azure Pipelines YAML?
Open an interactive chat with Bash
What is the difference between 'dependsOn' and 'condition' in Azure Pipelines YAML?
Open an interactive chat with Bash
Microsoft DevOps Engineer Expert AZ-400
Design and implement build and release pipelines
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .