AZ-104 Question 160
Single answerYou have a container image named vantageco.azurecr.io/myapp:latest stored in a private Azure Container Registry (ACR) called vantageco. You need to deploy this container to Azure Container Instances (ACI) in the resource group MyResourceGroup, in the East US region, with 2 CPU cores, 3.5 GB of memory, and expose port 80 publicly. You also want the container to have a DNS name label (myapp-staging) so that it can be accessed securely over its own domain. You need to provide the ACR credentials for the container image. Which Azure CLI command best meets these requirements?
- A
az container create --resource-group MyResourceGroup --name mycontainer --image vantageco.azurecr.io/myapp:latest --cpu 2 --memory 3.5 --ports 80 --dns-name-label myapp-staging --registry-login-server vantageco.azurecr.io --registry-username
--registry-password --location eastus - B
az container create --resource-group MyResourceGroup --name mycontainer --image vantageco.azurecr.io/myapp:latest --cpu 1 --memory 1.5 --ports 80 --location eastus
- C
az container create --resource-group MyResourceGroup --name mycontainer --image vantageco.azurecr.io/myapp:latest --cpu 2 --memory 3.5 --ports 80 --dns-name-label myapp-staging --location eastus
- D
az container create --resource-group MyResourceGroup --name mycontainer --image vantageco.azurecr.io/myapp:latest --cpu 2 --memory 3.5 --registry-login-server vantageco.azurecr.io --registry-username
--registry-password
Show answer and explanation
Correct answer: A
Explanation
To provision a container from a private ACR in Azure Container Instances, you must provide the correct CPU and memory settings, and you must include the registry credentials if the image is stored in a private repository. Additionally, specifying a DNS name label and port mapping is necessary to make the container publicly accessible. Only the first option satisfies all these requirements.
- A. Correct.
Includes correct CPU, memory, ports, DNS label, location, and private registry credentials needed for deploying the container from the private ACR.
- B. Incorrect.
Specifies incorrect CPU and memory resources, and does not include DNS label or credentials to access the private ACR.
- C. Incorrect.
Specifies correct CPU, memory, and DNS label, but does not include credentials to access the private ACR.
- D. Incorrect.
Specifies correct CPU, memory, and the private registry credentials, but does not set a DNS label or expose port 80 properly.