AZ-104 Question 156
Single answerYou work for a company that needs to run an internal application in a container, accessible through a custom DNS name label. The container image must remain private. In the Azure portal, which approach requires the least overhead while still allowing you to store your images privately and configure environment variables and DNS settings for the container?
- A
Use Azure Container Registry to store your private image, then create an Azure Container Instance in the portal, configuring environment variables and DNS name label during this process.
- B
Provision an Azure Kubernetes Service (AKS) cluster, push your container image to Azure Container Registry, and create a Kubernetes deployment with an external load balancer.
- C
Create an Azure Web App for Containers that references an external container registry, then set the environment variables and DNS name label in App Service settings.
- D
Set up an Azure virtual machine, install Docker, pull your image from a private repository, and manually configure environment variables and DNS through a custom domain.
Show answer and explanation
Correct answer: A
Explanation
Azure Container Instances paired with Azure Container Registry is often the simplest and most efficient solution for privately storing and running containers managed through the Azure portal. This setup enables configuring environment variables and DNS labels without the complexity of managing a full-blown orchestrator or virtual machine.
- A. Correct.
This approach uses Azure Container Registry (ACR) for private storage and Azure Container Instances (ACI) for running containers with minimal overhead. You can configure environment variables and a DNS label directly while creating the container instance in the Azure portal.
- B. Incorrect.
AKS provides orchestrator-level features and is more complex to maintain, requiring you to manage cluster scaling and configuration. It is not the least overhead solution.
- C. Incorrect.
While Azure Web App for Containers does support custom container images, it is primarily designed for web applications. It can be simple, but still more complex than ACI for ephemeral or lightweight container workloads.
- D. Incorrect.
Using a virtual machine requires OS patching, manual Docker installation, and DNS configuration, which introduces significant overhead compared to running containers on ACI.