AZ-104 Question 154
Single answerYou need to containerize a custom web application and deploy it in Azure using an image stored in a private Azure Container Registry (ACR). Your plan is to use Azure Container Instances (ACI) and configure all settings directly in the Azure portal. Which step is essential to ensure the container can pull the image from your private ACR?
- A
Create a system-assigned managed identity for the container group and grant it pull permissions in the ACR
- B
Enable a firewall rule that allows inbound traffic to the ACR from any public IP addresses
- C
Use a public repository name in the container instance configuration instead of the ACR registry name
- D
Store the container registry credentials in Azure Key Vault without referencing them in the container group settings
Show answer and explanation
Correct answer: A
Explanation
When deploying a container from a private Azure Container Registry to Azure Container Instances, the container instance must authenticate with the registry. Using a system-assigned managed identity and granting it the appropriate Azure role (for example, ACR Pull) allows the container group to securely pull images from the private registry without exposing credentials.
- A. Correct.
A system-assigned managed identity for the container group, combined with proper role assignment on the Azure Container Registry, allows the container to securely pull images from the private repository.
- B. Incorrect.
Although opening the ACR to all inbound traffic might allow access, it unnecessarily compromises security and is not aligned with best practices for private registries.
- C. Incorrect.
Using a public repository name in the container instance configuration does not solve private access requirements for an ACR, this would only work for publicly accessible images.
- D. Incorrect.
While storing credentials in Azure Key Vault is a valid security practice, you must explicitly configure those credentials or managed identity references in the container settings for the pull operation to succeed.