AZ-400 Preserve previous deployment for rollback Practice Question
You configured a multi-stage YAML pipeline with a deployment job that uses a deployment strategy like 'runOnce' or 'rolling'. You need to ensure that the deployment target is marked as 'succeeded' only after the deployment job completes successfully, and that any previous deployment to the same environment is preserved for rollback. Which setting must you configure?
⚠ Common exam trap
Many candidates confuse deployment strategies (rolling, blue-green) with revision retention, assuming that a strategy like 'rolling' or 'blueGreen' inherently preserves previous deployments for rollback, when in fact retention is a separate environment-level setting.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Set the environment's 'retain' property to 1 or more
Setting the environment's 'retain' property to 1 or more ensures that the previous deployment (e.g., the last successful run) is preserved as a 'retained' revision in the environment. This allows you to redeploy that specific revision for rollback purposes. The deployment job marks the environment target as 'succeeded' only after the job completes successfully, and retaining previous revisions prevents them from being automatically cleaned up.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Set the environment's 'retain' property to 1 or more
Why this is correct
Setting the environment's 'retain' property to 1 or more instructs Azure Pipelines to keep the specified number of previous deployments for that environment. This retained deployment history enables rollback to a prior version, as the pipeline can redeploy the previous artifact without needing to recreate it.
- ✗
Set the deployment job's 'continueOnError' to true
Why it's wrong here
Setting the deployment job's 'continueOnError' to true only causes the job to report success even when step failures occur, so subsequent jobs or stages run regardless. It does not preserve or store previous deployment artifacts; hence it does not provide any rollback capability.
- ✗
Use the 'deployment' job with 'strategy: rolling'
Why it's wrong here
Using the 'deployment' job with 'strategy: rolling' defines a rollout pattern where updates are progressively applied across instances, but it does not inherently retain older deployments. While rolling deployment can reduce downtime, it does not dictate how many previous versions are kept for rollback purposes.
- ✗
Set the 'deploymentStrategy' to 'blueGreen'
Why it's wrong here
Setting the 'deploymentStrategy' to 'blueGreen' (or specifying 'strategy: blueGreen' in a deployment job) describes a traffic-switching deployment method that can facilitate rollback by keeping the blue environment alive. However, this is a deployment strategy, not a retention setting; it does not guarantee that previous deployments are preserved unless the environment's 'retain' property is also configured.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-400 exam frequently reuses these exact scenarios with slightly different constraints.
✓Set the environment's 'retain' property to 1 or moreCorrect answer▾
Why this is correct
Setting the environment's 'retain' property to 1 or more instructs Azure Pipelines to keep the specified number of previous deployments for that environment. This retained deployment history enables rollback to a prior version, as the pipeline can redeploy the previous artifact without needing to recreate it.
✗Set the deployment job's 'continueOnError' to trueWrong answer — click to see why▾
Why this is wrong here
This would continue on failure, not preserve previous deployments.
✗Use the 'deployment' job with 'strategy: rolling'Wrong answer — click to see why▾
Why this is wrong here
This defines the update strategy but does not control retention of history.
✗Set the 'deploymentStrategy' to 'blueGreen'Wrong answer — click to see why▾
Why this is wrong here
Blue-green is a deployment strategy, but retention is still controlled by environment settings.
Analysis generated from the official AZ-400blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
Learn chapter
Source Control Strategy Design
Key term
Environment
An environment is a dedicated set of computing resources, configurations, and services used to develop, test, or host software applications in a controlled and repeatable way.
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
About these practice questions
One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.