The answer is Never. This is the correct restart policy for the container group because it is running a batch job designed to execute once and then terminate, and the Never policy ensures the container does not restart after it completes or fails. Azure Container Instances supports three restart policies—Always, OnFailure, and Never—and for a single-run workload like a one-time data processing task, Never is the only choice that prevents any automatic restart, aligning with the requirement that the container exits permanently. On the AZ-104 exam, this scenario tests your understanding of how container lifecycle maps to workload types; a common trap is selecting OnFailure, which would restart only after a non-zero exit code, but for a batch job that should never rerun, Never is mandatory. Remember the mnemonic: "One and done, Never's the one."
AZ-104 Deploy and Manage Azure Compute Practice Question
This AZ-104 practice question tests your understanding of deploy and manage azure compute. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
Container group configuration:
- Name: cg-nightly-import
- Container image: contoso.azurecr.io/importer:1.2
- Job behavior: the process imports files, exits with code 0 on success, and should not run again until the next scheduled deployment
- Requirement: do not restart the container after successful completion
Based on the exhibit, which restart policy should be configured for the container group?
Container group configuration:
- Name: cg-nightly-import
- Container image: contoso.azurecr.io/importer:1.2
- Job behavior: the process imports files, exits with code 0 on success, and should not run again until the next scheduled deployment
- Requirement: do not restart the container after successful completion
A
Always
Why wrong: Always would restart the container even after successful completion, which conflicts with the one-time job requirement.
B
OnFailure
Why wrong: OnFailure restarts when the container exits with an error, but the job should not restart after success either.
C
Never
Never is the correct restart policy for a one-time task that should stop after finishing successfully. The exhibit describes a batch-style import job, not a long-running service. Using Never ensures the container exits and stays stopped until the next deployment or scheduled run. That behavior matches operational expectations for a completed import process.
D
UnlessStopped
Why wrong: UnlessStopped is not the right ACI behavior for a completed one-time task and would imply continued restart behavior.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Never
The container group in the exhibit is configured with a restart policy of 'Never' because it is designed to run a batch job that should execute once and then terminate. Azure Container Instances supports three restart policies: Always, OnFailure, and Never. Since the task is a one-time job, 'Never' ensures the container does not restart after completion, which is the correct choice for a single-run workload.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
Always
Why it's wrong here
Always would restart the container even after successful completion, which conflicts with the one-time job requirement.
✗
OnFailure
Why it's wrong here
OnFailure restarts when the container exits with an error, but the job should not restart after success either.
✓
Never
Why this is correct
Never is the correct restart policy for a one-time task that should stop after finishing successfully. The exhibit describes a batch-style import job, not a long-running service. Using Never ensures the container exits and stays stopped until the next deployment or scheduled run. That behavior matches operational expectations for a completed import process.
Related concept
Read the scenario before looking for a memorised answer.
✗
UnlessStopped
Why it's wrong here
UnlessStopped is not the right ACI behavior for a completed one-time task and would imply continued restart behavior.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates confuse Docker's native restart policies (which include 'UnlessStopped') with Azure Container Instances' supported policies, leading them to select 'UnlessStopped' even though it is not available in ACI.
Detailed technical explanation
How to think about this question
Azure Container Instances restart policies are enforced at the container group level and map to Docker's restart policies but with limited options: Always (equivalent to Docker's 'always'), OnFailure (equivalent to Docker's 'on-failure'), and Never (equivalent to Docker's 'no'). When a container group is set to 'Never', the container runs once and stops; the group remains in a 'Stopped' state until manually deleted or restarted. This is ideal for batch processing, data migration, or one-time scripts where restarting would cause duplicate work or errors.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.
Related glossary terms
Concepts from this question explained
These glossary pages explain the core terms tested in this AZ-104 question in full detail.
Deploy and Manage Azure Compute — This question tests Deploy and Manage Azure Compute — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Never — The container group in the exhibit is configured with a restart policy of 'Never' because it is designed to run a batch job that should execute once and then terminate. Azure Container Instances supports three restart policies: Always, OnFailure, and Never. Since the task is a one-time job, 'Never' ensures the container does not restart after completion, which is the correct choice for a single-run workload.
What should I do if I get this AZ-104 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This AZ-104 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-104 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.