You are deploying a containerized application to Azure Container Instances (ACI) that hosts an API listener. The application must run continuously. If the application process exits with an exit code of 0 (successful termination) after completing an internal self-update, the container must be restarted automatically to resume listening for requests. Which restart policy should you configure for the container group?
- AlwaysAnswer
- BOnFailure
- CNever
- DOnSuccess
Answer
Always
The correct answer is Always because the workload requires a continuous running state. In Azure Container Instances, the Always restart policy guarantees that containers in the group are restarted regardless of their exit status (0 or non-zero). Since the listener container exits with code 0 after self-updating, the Always policy ensures that it is restarted to continue processing requests.
Step-by-Step Solution
Key Concept
Azure Container Instances restart policies determine how ACI manages the lifecycle of containers in a group based on their exit codes. For long-running or continuous services, the Always policy is used to guarantee that the containers are restarted after any termination, including successful exits.
Estimated Time:1m 30s