Question

Difficulty: MediumRun Containerized Solutions using Azure Container Instances

You are planning to deploy a containerized application to Azure Container Instances (ACI). The container requires access to a persistent volume hosted on an Azure File Share. You decide to use the Azure CLI to provision the resources and deploy the container. Which sequence of steps should you perform to create the storage resources and deploy the container with the mounted volume?

  1. 1Run the `az storage account create` command to provision a new storage account.
  2. 2Run the `az storage account keys list` command to retrieve the access keys for the storage account.
  3. 3Run the `az storage share create` command, passing the storage account name and access key, to create the file share.
  4. 4Run the `az container create` command, specifying the volume mount parameters, including the file share name, storage account name, and storage account key.

Answer

To deploy a container to Azure Container Instances with a mounted Azure File Share, you must first create the storage account, retrieve its access keys, create the file share within the storage account using those keys, and finally deploy the container group using the `az container create` command with the appropriate volume mount parameters.
The correct sequence starts with provisioning the physical storage account. Next, the access keys must be retrieved because they are required to authorize the creation of the file share and the subsequent mount operation. Once the keys are available, the file share is created. Finally, the container group is created using the container deployment command, which references the storage account, key, and share to mount the volume to the container.

Step-by-Step Solution

1
Create the storage account
A storage account is provisioned in Azure.
You need a storage account to host the Azure File Share.
2
Retrieve the storage account keys
The primary and secondary storage access keys are obtained.
The access keys are required to authenticate the creation of the file share and to allow ACI to mount the volume.
3
Create the Azure File Share
An SMB file share is created within the storage account.
ACI mounts an existing file share, so the share must exist prior to container deployment.
4
Deploy the container with the mounted volume
The ACI container group is created and the file share is mounted to the specified path.
The container group needs to reference the storage account credentials and share name at creation time to mount it.

Key Concept

Mounting an Azure File Share as a persistent volume in Azure Container Instances
Rate this question