AZ-104 Deploy and Manage Azure Compute Practice Question
A container group runs a one-time import task and should stop after the task completes successfully. Which restart policy should you use?
⚠ Common exam trap
Many candidates confuse 'OnFailure' with 'Never' for one-time tasks, mistakenly thinking that 'OnFailure' will stop after success, but it actually restarts on failure, which is not the same as stopping unconditionally after completion.
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
✓
Never
The 'Never' restart policy is correct because the container group is designed to run a one-time import task and should stop after successful completion. In Azure Container Instances (ACI), the 'Never' policy ensures the container runs exactly once and does not restart, regardless of the exit code. This is ideal for batch jobs or import tasks that should not be retried automatically.
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
This would restart the container every time it exits, which is not suitable for a one-time job.
When this WOULD be correct
A container group running a long-running service (e.g., a web server) that must be automatically restarted if it crashes or stops unexpectedly. The question would specify 'continuous service' or 'high availability' requirements.
- ✗
OnFailure
Why it's wrong here
This restarts only after failure, but the question asks for the policy that stops after a successful one-time run.
When this WOULD be correct
This option would be correct if the question specified that the container group runs a batch job that might fail and should be retried automatically on failure. For example: 'A container group runs a data processing job that should restart only if it fails. Which restart policy should you use?'
- ✓
Never
Why this is correct
Never lets the container run once and then stop, which fits a batch or import task that should not restart.
- ✗
Manual
Why it's wrong here
Manual is not a valid Azure Container Instances restart policy, so it cannot be selected.
When this WOULD be correct
This option would be correct if the question asked about a different service, such as Azure Container Apps or a custom orchestration tool, where a manual restart policy exists to require explicit user action to restart containers.
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-104 exam frequently reuses these exact scenarios with slightly different constraints.
✓NeverCorrect answer▾
Why this is correct
Never lets the container run once and then stop, which fits a batch or import task that should not restart.
✗AlwaysWrong answer — click to see why▾
Why this is wrong here
The 'Always' restart policy restarts the container regardless of exit code, which would prevent the one-time import task from stopping after completion. The task should stop after success, so 'Never' is correct.
★ When this WOULD be the correct answer
A container group running a long-running service (e.g., a web server) that must be automatically restarted if it crashes or stops unexpectedly. The question would specify 'continuous service' or 'high availability' requirements.
Why candidates choose this
Candidates may think 'Always' ensures reliability, not realizing that for a one-time task, it would cause infinite restarts instead of stopping.
✗OnFailureWrong answer — click to see why▾
Why this is wrong here
The 'OnFailure' restart policy restarts the container if it exits with a non-zero exit code, but the task is expected to complete successfully (exit code 0), so the container would not restart and would stop. However, the question requires the container to stop after completion, and 'Never' ensures it never restarts regardless of exit code, which is the correct choice for a one-time task.
★ When this WOULD be the correct answer
This option would be correct if the question specified that the container group runs a batch job that might fail and should be retried automatically on failure. For example: 'A container group runs a data processing job that should restart only if it fails. Which restart policy should you use?'
Why candidates choose this
Candidates may confuse 'OnFailure' with 'Never' because both can result in the container stopping after completion. They might think 'OnFailure' is appropriate for a task that should stop after success, but they overlook that 'OnFailure' restarts on failure, which is unnecessary for a guaranteed successful task.
✗ManualWrong answer — click to see why▾
Why this is wrong here
Azure Container Instances does not support a 'Manual' restart policy; the valid policies are Always, OnFailure, and Never. Manual is not a recognized option.
★ When this WOULD be the correct answer
This option would be correct if the question asked about a different service, such as Azure Container Apps or a custom orchestration tool, where a manual restart policy exists to require explicit user action to restart containers.
Why candidates choose this
Candidates may confuse container restart policies with other Azure resource management concepts (e.g., manual scaling or manual start/stop of VMs) and assume a manual policy exists for containers.
Analysis generated from the official AZ-104blueprint 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
Managed Identities for Azure Resources
Key term
Azure Container Instances
Azure Container Instances (ACI) is a PaaS service that lets you run a container directly in Azure without managing any underlying servers or orchestration.
Key term
Container
A container is a lightweight, standalone software package that includes everything needed to run an application, such as code, runtime, system tools, and libraries.
About these practice questions
This AZ-104 question is part of Courseiva's 1,049-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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-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.