Microsoft DevOps Engineer Expert AZ-400 Practice Question
Your Azure DevOps project contains a single-stage YAML pipeline that is triggered by every push to the main branch. During periods of high activity, developers often push several commits within a few minutes, leading to multiple runs being queued and unnecessary consumption of Microsoft-hosted agents. You must ensure that no more than one run of this pipeline executes at any time and that any in-progress or queued run is automatically cancelled when a newer commit is detected, thereby reducing agent usage charges and queue length.
Which YAML modification should you implement to meet this requirement?
Enable batching by adding batch: true to the continuous-integration trigger.
Add a root-level concurrency block that specifies a shared group name and sets cancelInProgress to true.
Configure the pool section with demands that set minimumParallelJobs to 1.
Define a retention policy with minimumRuns: 1 and days: 0 to keep only the latest successful run.
A pipeline-level concurrency block lets you place all runs of the pipeline into the same named group and, when cancelInProgress is set to true, Azure Pipelines automatically cancels any earlier queued or running instance as soon as a newer run is queued. This guarantees that at most one run is active, eliminating wasted agent minutes.
Batching a CI trigger defers queuing new runs until the current one completes but does not cancel a running build, so multiple runs can still execute consecutively.
Retention policies control how long completed runs and their artifacts are stored; they do not affect how many runs can execute concurrently.
Pool settings such as demands or a fictitious minimumParallelJobs property cannot limit pipeline-level concurrency or cancel in-progress runs.
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 is a concurrency block in Azure Pipelines?
Open an interactive chat with Bash
How does batching work in a CI trigger, and why is it not ideal here?
Open an interactive chat with Bash
What is the purpose of retention policies in Azure Pipelines, and why don't they apply here?
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 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .