Courseiva
Develop Azure compute solutionseasyMultiple ChoiceObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

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?

⚠ Common exam trap

Candidates often confuse 'emptyDir' (which is ephemeral and often used in Kubernetes for temporary storage) with a persistent volume, not realizing that ACI's emptyDir is also ephemeral and does not survive container group restarts.

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 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.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use an emptyDir volume within the container group.

    Why it's wrong here

    An emptyDir volume in Azure Container Instances (ACI) provides a temporary, empty directory for a container group. Its lifecycle is strictly tied to the container group itself; data stored within an emptyDir is entirely ephemeral and will be irrevocably lost if the container group is stopped, restarted, or deleted. This makes it unsuitable for any application requiring persistent data storage across container group lifecycles or restarts.

  • Mount an Azure Files share as a volume in the container group.

    Why this is correct

    Mounting an Azure Files share as a volume in an Azure Container Instances (ACI) container group is the correct approach for persistent storage. Azure Files offers fully managed, highly available file shares that can be accessed via the SMB protocol, ensuring data durability and availability even if the container group is stopped, restarted, or deleted. The data resides independently in Azure Storage, allowing new or restarted container instances to access the same persistent state.

  • Use the container's own filesystem and copy data to a blob storage on shutdown.

    Why it's wrong here

    Relying on the container’s own filesystem means data is ephemeral and lost when the container stops, so it cannot survive a crash or redeployment. Copying to blob storage on shutdown is tempting because it mimics a backup pattern for stateful data, but it fails because a crash provides no opportunity to run the shutdown logic, and redeployment would not automatically restore the data from blob storage into the new container’s local directory.

  • Enable Azure Disk Encryption on the container group.

    Why it's wrong here

    Enabling Azure Disk Encryption (ADE) on a container group primarily addresses data security at rest by encrypting the underlying disks used by the container instances. While crucial for compliance and protecting sensitive data, ADE is a security feature and does not inherently provide data persistence across container group restarts, deletions, or redeployments. The data itself, whether encrypted or not, would still be ephemeral if stored only on the container's local filesystem.

About these practice questions

Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.