AZ-104 Deploy and Manage Azure Compute Practice Question
A container group runs a one-time import job in Azure Container Instances. After the job finishes successfully, it should not restart. Which restart policy should you choose?
⚠ Common exam trap
Many candidates confuse 'OnFailure' with 'Never' for a successful job, but 'OnFailure' still allows restarts on failure, which violates the 'should not restart' requirement; the question explicitly states the job finishes successfully, so the correct policy is 'Never' to guarantee no restart under any condition.
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 ensures that the container group does not restart after the job completes, which is ideal for a one-time import job that should run exactly once. Azure Container Instances supports three restart policies: Always, OnFailure, and Never. For a job that must not restart after successful completion, 'Never' is the correct choice because it prevents any automatic restart regardless of the exit code.
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
The Always restart policy in Azure Container Instances relaunches the container group every time it stops, regardless of whether the process exited with code 0 or a non-zero code. For a one-time import job that finishes successfully, this would cause the container to execute repeatedly in an infinite loop, re-running the import logic and potentially creating duplicate or corrupted data. The job is meant to run once and then remain terminated, so Always is inappropriate because it forces continuous re-execution even after a clean exit.
When this WOULD be correct
Choose 'Always' for a long-running service like a web server or API endpoint that must be automatically restarted if it stops, ensuring high availability.
- ✗
OnFailure
Why it's wrong here
The OnFailure restart policy restarts the container group only when the process exits with a non-zero exit code, which signifies an error. In the context of a one-time import job, this means a transient failure could trigger automatic retries, potentially leading to an unbounded restart loop if the underlying issue isn't resolved. While a successful run would stop cleanly, the job's semantics are 'run exactly once'—not 'retry on failure'—so OnFailure introduces an unwanted retry behavior that doesn't match the requirement of a strictly one-time task.
When this WOULD be correct
This policy would be correct for a job that should automatically retry on failure, such as a data processing task that must be re-run if it fails due to transient errors. For example, a batch job that imports data from an external source and should restart only if the import fails.
- ✓
Never
Why this is correct
Never is the correct restart policy for a one-time task that should run once and then stop. Azure Container Instances will not try to restart the container after it exits, even if it finishes successfully. That behavior matches import jobs, batch scripts, and other short-lived workloads that should complete and remain stopped.
- ✗
Manual
Why it's wrong here
Manual is not a valid restart policy for Azure Container Instances. The only restart policies supported by the ACI API and CLI are Always, OnFailure, and Never. Attempting to set Manual as the restartPolicy parameter would cause a validation error and prevent the container group from being created. This option is a distractor that might sound plausible but has no technical basis in the platform.
When this WOULD be correct
If the question were about a Docker container running on a virtual machine or a Kubernetes pod, where you can manually restart the container after it stops, then 'Manual' could be a plausible option. However, for Azure Container Instances, it is not a valid choice.
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 is the correct restart policy for a one-time task that should run once and then stop. Azure Container Instances will not try to restart the container after it exits, even if it finishes successfully. That behavior matches import jobs, batch scripts, and other short-lived workloads that should complete and remain stopped.
✗AlwaysWrong answer — click to see why▾
Why this is wrong here
The 'Always' restart policy restarts the container regardless of exit code, which is inappropriate for a one-time import job that should not restart after successful completion.
★ When this WOULD be the correct answer
Choose 'Always' for a long-running service like a web server or API endpoint that must be automatically restarted if it stops, ensuring high availability.
Why candidates choose this
Candidates may assume 'Always' ensures the job runs continuously, but they overlook that the job is designed to run once and exit.
✗OnFailureWrong answer — click to see why▾
Why this is wrong here
The 'OnFailure' policy restarts the container only if it exits with a non-zero exit code, but the job completes successfully (exit code 0), so it would not restart. However, the question requires that the container should not restart at all after success, making 'Never' the correct choice.
★ When this WOULD be the correct answer
This policy would be correct for a job that should automatically retry on failure, such as a data processing task that must be re-run if it fails due to transient errors. For example, a batch job that imports data from an external source and should restart only if the import fails.
Why candidates choose this
Candidates may think 'OnFailure' is appropriate because the job is one-time and should not restart on success, but they overlook that the policy still allows restarts on failure, which is not desired here. They confuse 'not restarting after success' with 'not restarting at all'.
✗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.
★ When this WOULD be the correct answer
If the question were about a Docker container running on a virtual machine or a Kubernetes pod, where you can manually restart the container after it stops, then 'Manual' could be a plausible option. However, for Azure Container Instances, it is not a valid choice.
Why candidates choose this
Candidates might assume that 'Manual' is a standard restart policy similar to Docker's restart policies, but Azure Container Instances has its own set of policies that do not include Manual.
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
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.
Key term
Group
A group is a collection of users, devices, or other objects that are assigned permissions and policies together for simplified management in identity and governance systems like Microsoft Entra ID.
About these practice questions
Courseiva writes every AZ-104 question from scratch — 1,049 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.