Question

Difficulty: EasyConfigure Azure Container Instances (ACI)

You are deploying a database schema migration task to Azure Container Instances (ACI). If the migration script fails during execution, running it a second time automatically could result in data corruption. You must ensure that the container does not restart under any circumstances once it stops. Which restart policy should you configure for the container group?

  1. NeverAnswer
  2. B
    Always
  3. C
    OnFailure
  4. D
    None

Answer

Never
The 'Never' restart policy guarantees that the container will execute exactly once. It will not attempt to restart regardless of whether the process finishes successfully (zero exit code) or fails with an error (non-zero exit code). This is ideal for tasks like database migrations where automatic retries could corrupt data.

Step-by-Step Solution

1
Analyze the workload requirements for the container group.
The container runs a database schema migration script once, and must not restart under any circumstances (success or failure) to avoid data corruption.
Identifying the desired lifecycle behavior determines the correct restart policy.
2
Evaluate the available Azure Container Instances (ACI) restart policies.
ACI supports three restart policies: 'Always', 'Never', and 'OnFailure'.
Knowing the valid options helps eliminate invalid configurations.
3
Select the policy that matches the requirement of zero restarts.
The 'Never' policy matches the requirement because it prevents restarts for both successful and failed executions.
Matching the requirements to the definition of 'Never' yields the correct configuration.

Key Concept

Azure Container Instances (ACI) Restart Policies
Rate this question