AZ-104 Question 162
Single answerYou are configuring an Azure Container Instance to run a container that processes images from Azure Blob Storage. The container is a publicly available image hosted on Docker Hub. You must ensure that all container logs are stored in an Azure Storage file share named 'imageLogs' in an existing storage account. Which approach should you choose when provisioning the container instance?
- A
Specify the Azure File volume parameters --azure-file-volume-account-name, --azure-file-volume-account-key, --azure-file-volume-share-name, and a mount path in the az container create command
- B
Configure the container logs to be streamed directly to Azure Monitor logs without mounting a file share
- C
Use an Azure Kubernetes Service (AKS) cluster and create a PersistentVolumeClaim that references the storage account
- D
Configure a managed identity for the container instance and rely on an ARM template to mount the file share automatically
Show answer and explanation
Correct answer: A
Explanation
To mount an Azure file share in Azure Container Instances, you must explicitly specify the Azure File volume parameters in your az container create command. This ensures logs are automatically stored in the designated file share without additional overhead or services.
- A. Correct.
This is the correct approach. Specifying Azure File volume parameters and a mount path during container creation ensures that the container’s log files are automatically written to the Azure Storage file share.
- B. Incorrect.
While streaming logs to Azure Monitor is possible, it does not automatically store logs in a file share. You still need to mount the share to continuously write logs there.
- C. Incorrect.
AKS is not required for a single container instance. It introduces unnecessary overhead and complexity just to mount a file share for logs.
- D. Incorrect.
Although a managed identity can secure access to resources, you still must explicitly configure the volume mount for the file share in Azure Container Instances.