Azure Container Instances Persistent Storage with Azure Files
You deploy a containerized application on Azure Container Instances (ACI). The application writes data that must persist across container restarts and be accessible from multiple instances. Which volume mount should you configure?
Quick Answer
The answer is Azure Files share, because it provides a fully managed SMB file share that can be mounted as a volume in Azure Container Instances, enabling persistent storage for data across container restarts and concurrent access from multiple instances. This works because Azure Files stores data in a remote storage account, decoupling the data lifecycle from the container’s ephemeral state—unlike the container’s temporary disk, which is lost on restart. On the AZ-204 exam, this scenario tests your understanding of stateful workloads in serverless containers, often appearing as a distractor against options like Azure Blob Storage (which lacks native SMB mounting in ACI) or the container’s ephemeral volume. A common trap is assuming any Azure storage works, but only Azure Files supports the SMB protocol required for ACI volume mounts with shared, durable access. Memory tip: think “Files for persistence, Blobs for objects”—if it needs to survive a restart and be shared, mount an Azure Files share.
⚠ Common exam trap
Watch out — candidates often confuse Azure Disk (which is block storage with ReadWriteOnce semantics) with Azure Files (which is file storage with ReadWriteMany semantics), leading candidates to choose Azure Disk for persistence without considering multi-instance access requirements.
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
✓
Azure Files share
Azure Files shares provide a fully managed SMB file share in the cloud that can be mounted as a volume in Azure Container Instances. This allows data written by the container to persist across restarts and be accessed concurrently by multiple container instances, meeting the requirements for durability and shared access.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Azure Files share
Why this is correct
Azure Files offers SMB shares that can be mounted as volumes in ACI, persisting data independent of the container lifecycle.
- ✗
emptyDir volume
Why it's wrong here
emptyDir is a temporary volume that is cleared when the container restarts.
- ✗
Azure Disk
Why it's wrong here
Azure Disk is not natively supported in ACI; it requires a sidecar container or use of virtual machines.
- ✗
ConfigMap
Why it's wrong here
ConfigMaps are used for injecting configuration data, not for persistent storage.
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 →
Same concept, more angles
5 more ways this is tested on AZ-204
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. You deploy a containerized web application to Azure Container Instances (ACI). The application writes session data to a local directory. You need the data to persist across container restarts (e.g., after a crash or redeployment). Which storage configuration should you use?
easy- A.Use an emptyDir volume within the container group.
- ✓ B.Mount an Azure Files share as a volume in the container group.
- C.Use the container's own filesystem and copy data to a blob storage on shutdown.
- D.Enable Azure Disk Encryption on the container group.
Why B: Azure Files provides a fully managed SMB file share in the cloud that can be mounted as a volume in an Azure Container Instance. This allows session data written to the local directory to persist across container restarts, crashes, or redeployments, as the data lives on the share rather than in the ephemeral container filesystem.
Variation 2. You deploy a containerized application to Azure Container Instances (ACI). The application writes logs that must persist across container restarts and be accessible from a file system. The solution must minimize cost and complexity. Which configuration should you use?
medium- ✓ A.Mount an Azure Files share as a volume
- B.Store logs in Azure Container Registry
- C.Use a Docker volume in the container
- D.Pass log path via an environment variable
Why A: Mounting an Azure Files share as a volume in Azure Container Instances provides persistent, shared file storage that survives container restarts and is accessible via the container's file system. This approach minimizes cost by using standard Azure Files storage (pay only for consumed capacity) and complexity by leveraging ACI's native volume mount support without requiring additional orchestration or stateful infrastructure.
Variation 3. You deploy a containerized application to Azure Container Instances (ACI). The application writes state to the /data directory. You need to ensure that if the container restarts, the data persists. Which type of volume mount should you use?
medium- ✓ A.Azure Files share
- B.emptyDir volume
- C.hostPath volume
- D.Azure Disk volume
Why A: Azure Files shares provide a fully managed SMB file share in the cloud that can be mounted to Azure Container Instances. When a container restarts, the data written to the /data directory persists because the share lives independently of the container lifecycle, ensuring state survives crashes or restarts. Azure Disk volumes also provide persistent storage for ACI and would similarly ensure data persistence across container restarts.
Variation 4. 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?
medium- ✓ A.Mount an Azure Files share as a volume in the container group.
- B.Use the container's writable layer to store files.
- C.Use Azure Blob Storage and mount it as a volume.
- D.Configure a Docker volume in the container image.
Why A: 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.
Variation 5. You are deploying a containerized application to Azure Container Instances (ACI). The application writes temporary data to a local disk that must persist across container restarts (e.g., after a crash). Which configuration should you use?
easy- ✓ A.Mount an Azure Files share as a volume in the container group.
- B.Use the temporary disk automatically allocated by ACI.
- C.Store data in an Azure Cosmos DB database.
- D.Use an emptyDir volume as available in Kubernetes.
Why A: Azure Container Instances (ACI) supports mounting an Azure Files share as a persistent volume. When a container restarts (e.g., after a crash), the temporary disk is wiped, but data written to an Azure Files share persists independently of the container's lifecycle. This meets the requirement for data to survive container restarts.
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.