An administrator is configuring a container group in Azure Container Instances (ACI) to execute a scheduled database maintenance script. The script runs for approximately 10 minutes and then terminates. If the script exits with a non-zero code, it must attempt to run again. If it exits with code 0, the container group must release its compute resources. Which setting should the administrator configure to achieve this behavior?
- ARestart policy set to Always
- Restart policy set to OnFailureAnswer
- CRestart policy set to Never
- DRestart policy set to OnError
Answer
Restart policy set to OnFailure
The correct configuration is setting the restart policy to OnFailure. In Azure Container Instances (ACI), the OnFailure policy ensures that the containers in the container group are restarted only when the application process fails (returns a non-zero exit code). If the process succeeds (returns exit code 0), the containers stop and transition to a Terminated state, ensuring that billing stops and compute resources are released.
Step-by-Step Solution
Key Concept
Azure Container Instances (ACI) Restart Policies