Question

Difficulty: HardDeploy and Configure Azure Container Apps

You are deploying an Azure Container App named report-generator to an Azure Container Apps Environment. The Container App must read template files and write generated reports to a persistent, shared file share. You have already created an Azure Storage account. You need to configure the Container App to mount the Azure file share. Which sequence of steps should you perform?

  1. 1Create an Azure file share in the Azure Storage account.
  2. 2Link the Azure file share to the Container Apps Environment using the az containerapp env storage set command.
  3. 3Define a volume in the Container App's YAML configuration template that references the registered Environment storage resource.
  4. 4Configure a volume mount in the container properties of the template to map the defined volume to a target directory path.

Answer

First, create an Azure file share in the Storage account. Second, link the file share to the Container Apps Environment. Third, define a volume in the Container App configuration referencing the environment storage. Fourth, configure a volume mount in the container template to bind the volume to a directory path.
The correct sequence starts with provisioning the physical Azure File Share, registering it at the environment level to expose it to the container apps, defining the volume resource in the container app's template, and finally mapping that volume to a path within the container.

Step-by-Step Solution

1
Create the Azure file share in the Azure Storage account.
A physical file share is created and ready for connection.
The file share must exist before the Container Apps Environment can connect to it.
2
Run the az containerapp env storage set command to link the share to the Environment.
The file share is registered as an environment-level storage resource.
This makes the storage share accessible by any Container App running in that specific environment.
3
Define a volume under the template properties of the Container App configuration.
The volume is defined and linked to the registered environment storage.
The Container App must declare the volume at the template level before any container can mount it.
4
Add a volumeMounts entry in the container definition pointing to the volume.
The volume is mounted to a specific container path.
This maps the template volume to a path in the container's file system where the application can read and write files.

Key Concept

Azure Container Apps storage mounting requires linking the Azure file share at the Container Apps Environment level before defining it as a volume and mounting it inside individual containers.
Rate this question