Courseiva
Develop for Azure storagemediumMultiple ChoiceObjective-mapped

AZ-204 Develop for Azure storage Practice Question

You are developing a web application that uses Azure Files shares for storing user documents. Users complain that they sometimes see stale file listings. The application uses the SMB protocol. What should you do to ensure the file listing is always current?

⚠ Common exam trap

Candidates often confuse client-side caching with server-side features like soft delete or CDN, or assume that switching to a different API (REST) will bypass the caching issue, when in fact the root cause is the SMB protocol's built-in directory cache on the client.

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

Set the SMB_DIRECTORY_CACHE_MAX_AGE registry key to 0 on clients.

The SMB protocol caches directory listings on the client side to improve performance. By setting the SMB_DIRECTORY_CACHE_MAX_AGE registry key to 0, you disable this caching, forcing the client to always fetch the latest directory listing from the Azure file share. This ensures that users see current file listings instead of stale cached data.

Answer analysis

Option-by-option breakdown

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

  • Set the SMB_DIRECTORY_CACHE_MAX_AGE registry key to 0 on clients.

    Why this is correct

    SMB clients, by default, cache directory listings to improve performance and reduce network traffic. This caching can lead to stale views of the file share if changes are made by other clients or processes. Setting the SMB_DIRECTORY_CACHE_MAX_AGE registry key to 0 on the client machines effectively disables this directory caching. This forces the client to re-query the Azure File Share for the latest directory contents every time, ensuring immediate visibility of new or modified files and folders.

  • Enable soft delete for the file share.

    Why it's wrong here

    Enabling soft delete for an Azure file share is a data protection feature designed to safeguard against accidental or malicious deletion of files or the share itself. When soft delete is active, deleted items are retained for a specified period, allowing for recovery. However, this functionality solely pertains to data recovery and has no impact whatsoever on the real-time freshness or visibility of current directory listings for active users accessing the share.

  • Switch to using REST API for file listings.

    Why it's wrong here

    Switching to the Azure Files REST API for file listings would involve a fundamental architectural change for a web application currently using SMB. While the REST API provides programmatic access, it does not inherently guarantee immediate listing freshness, as server-side caching or proxy caching could still be in play. Furthermore, this approach introduces significant development effort and potential performance overhead compared to simply adjusting client-side SMB caching behavior.

  • Disable CDN caching for the storage account.

    Why it's wrong here

    Azure Content Delivery Network (CDN) is a global service primarily used to cache static web content and media files, delivering them quickly to users via HTTP/HTTPS endpoints. It is designed to improve the performance and availability of web applications by reducing latency for geographically dispersed users. Azure File Shares, when accessed via the Server Message Block (SMB) protocol, do not utilize CDN for file access or directory listings, making CDN caching settings entirely irrelevant to SMB client behavior.

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 →

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.