Question

Difficulty: HardConfigure Azure Container Instances (ACI)

You are deploying a containerized batch-processing utility to Azure Container Instances (ACI). The utility has the following requirements:
- It must run to completion, processing objects from an Azure storage queue.
- If the utility encounters an error during execution and terminates with a non-zero exit code, it must attempt to restart and run again.
- Once the utility completes processing successfully, it must shut down and not restart.
- The ACI container group must run inside a private virtual network named VNet1.

Which of the following configuration options should you select to meet these requirements? (Select TWO.)

  1. Set the restart policy of the container group to OnFailure.Answer
  2. Deploy the container group into a subnet in VNet1 delegated to Microsoft.ContainerInstance/containerGroups.Answer
  3. C
    Set the restart policy of the container group to Always.
  4. D
    Set the restart policy of the container group to Never.
  5. E
    Deploy the container group into a subnet in VNet1 delegated to Microsoft.Web/serverFarms.

Answer

Select the restart policy of the container group to OnFailure, and deploy the container group into a subnet in VNet1 delegated to Microsoft.ContainerInstance/containerGroups.
The requirement for the container to restart only on failure indicates that the OnFailure restart policy must be chosen. For integrating the ACI deployment into a private virtual network, Azure Container Instances requires a dedicated subnet that is explicitly delegated to the Microsoft.ContainerInstance/containerGroups service resource type.

Step-by-Step Solution

1
Analyze the container lifecycle requirements.
The workload is a batch utility that runs to completion but needs to retry on error, meaning it should not restart under normal completion (exit code 0) but must restart on failure (non-zero exit code).
This requirement determines the restart policy choice.
2
Select the correct ACI restart policy.
The OnFailure restart policy meets this condition. Always would cause infinite restarts on success, and Never would prevent retries on failure.
Only OnFailure behaves differently based on the exit code of the container.
3
Determine ACI network integration requirements.
ACI VNet integration requires deploying the container group into a subnet delegated specifically to Microsoft.ContainerInstance/containerGroups.
ACI cannot be deployed into a subnet delegated to other services or a subnet without delegation if VNet integration is configured.

Key Concept

Configuring restart policies and virtual network integration for Azure Container Instances (ACI).
Estimated Time:2m 0s
Rate this question