You are deploying a containerized application to Azure Container Instances (ACI) by using an Azure Resource Manager (ARM) template. You do not define the `restartPolicy` property in the container group definition. The application is designed to execute a one-time data synchronization script and then exit.
What will be the behavior of the container group after the application successfully completes the script and exits with an exit code of 0?
- The container group will continuously restart the container, resulting in repeated execution of the script.Answer
- BThe container group will transition to a Succeeded state and terminate without restarting.
- CThe container group will transition to a Failed state because the default policy expects a running process.
- DThe container group will pause the container and remain in a Running state without consuming compute charges.
Answer
The container group will continuously restart the container, resulting in repeated execution of the script.
The correct answer is correct because Azure Container Instances defaults to the 'Always' restart policy when the `restartPolicy` configuration is omitted from the deployment definition. This policy causes the container to restart indefinitely, even after a successful exit (exit code 0), causing the synchronization script to execute repeatedly.
Step-by-Step Solution
Key Concept
The default restart policy for Azure Container Instances is 'Always', which causes tasks designed to run once and exit to restart continuously if not explicitly configured with 'Never' or 'OnFailure'.
Estimated Time:1m 30s