You are deploying a multi-container group in Azure Container Instances (ACI) that includes a web application container and a log-forwarding sidecar container. The web application container must run continuously to handle user requests, and the sidecar container must also run continuously to read log files generated by the web application. Which of the following configuration settings must you apply to meet these requirements? (Select TWO)
- Set the restart policy of the container group to Always.Answer
- Define a shared volume and mount it to both containers.Answer
- CSet the restart policy of the container group to Never.
- DSet the restart policy of the container group to OnFailure.
- EAssign a separate public IP address to each container in the container group.
Answer
Configure the container group restart policy to Always and mount a shared volume to both containers.
To support a multi-container scenario where both the web application and logging sidecar run continuously and share log files, you must configure the restart policy of the container group to Always and define a shared volume mounted to both containers. The Always policy ensures that if either container stops, it is automatically restarted. A shared volume allows the log-forwarding sidecar to access the directory where the web application writes its log files.
Step-by-Step Solution
Key Concept
Azure Container Instances (ACI) multi-container groups share lifecycle, network, and storage. The restart policy is defined at the group level, and a shared volume is required to share files between containers in the group.