AZ-204 Develop Azure compute solutions Practice Question
You are deploying a containerized application to Azure Container Instances. The application requires writing temporary files to a local filesystem. You need to ensure that the files persist if the container restarts. What should you do?
⚠ Common exam trap
Watch out — candidates often confuse Azure Blob Storage (object storage) with Azure Files (SMB file share) and assume both can be mounted as volumes in ACI, but only Azure Files is supported for volume mounts in container groups.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Mount an Azure Files share as a volume in the container group.
Azure Container Instances (ACI) supports mounting Azure Files shares as volumes. When a container restarts, its writable layer is ephemeral and lost, but an Azure Files share persists independently. By mounting the share, temporary files written to the mount point survive container restarts, meeting the persistence requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Mount an Azure Files share as a volume in the container group.
Why this is correct
Mounting an Azure Files share as a volume within an Azure Container Instance (ACI) container group provides a robust solution for persistent and shared storage. This approach leverages the Server Message Block (SMB) or Network File System (NFS) protocol to connect the container to a managed file share, ensuring that data persists across container restarts and can be accessed by multiple containers within the same group or even different container groups. It is the recommended method for stateful applications requiring durable storage in ACI.
- ✗
Use the container's writable layer to store files.
Why it's wrong here
Storing files solely within the container's writable layer is inherently ephemeral, meaning any data written there will be lost when the container stops, restarts, or is deleted. This layer is designed for temporary operational data and changes specific to a running instance, not for persistent application data or configuration that needs to survive the container's lifecycle. Consequently, relying on the writable layer for critical data would lead to data loss and an inability to maintain application state across deployments.
- ✗
Use Azure Blob Storage and mount it as a volume.
Why it's wrong here
While Azure Blob Storage is excellent for storing large amounts of unstructured data, Azure Container Instances (ACI) does not natively support mounting Blob Storage directly as a file system volume within a container group. ACI's volume mounting capabilities are designed for file-based systems like Azure Files, not object storage protocols. To interact with Blob Storage from an ACI container, applications must use the Azure Storage SDKs or REST API, rather than treating it as a mounted file system.
- ✗
Configure a Docker volume in the container image.
Why it's wrong here
Azure Container Instances (ACI) is a managed service that abstracts away the underlying Docker daemon, and as such, it does not support Docker-specific volume configurations defined within a container image or on the host. ACI provides its own set of native volume types, such as Azure Files, emptyDir, secret, and gitRepo, which are configured at the container group level. Attempting to define or use Docker volumes directly within an ACI deployment would result in an unsupported configuration and deployment failure.
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Azure Files Shares
Azure Files Shares are fully managed cloud file shares that you can access from anywhere using standard industry protocols like SMB and NFS.
Key term
Azure Container Instances
Azure Container Instances (ACI) is a PaaS service that lets you run a container directly in Azure without managing any underlying servers or orchestration.
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.