AZ-204 Develop Azure compute solutions Practice Question
You are developing an application that runs on Azure App Service. The application needs to store session state. The session state must be shared across multiple instances of the app and survive restarts. You need to choose a session state provider. What should you use?
⚠ Common exam trap
Test-takers frequently choose the in-memory provider (Option C) because it is the simplest default in ASP.NET, forgetting that it fails the cross-instance sharing and restart survival requirements explicitly stated in the question.
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
✓
Use Azure Redis Cache as a session state provider.
Azure Redis Cache provides a distributed, in-memory data store that can be shared across multiple instances of an App Service application and persists data through restarts. It is the recommended session state provider for Azure App Service when high availability and scalability are required, as it stores session data externally from the application's memory.
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 Azure Table Storage for session state.
Why it's wrong here
Azure Table Storage is a NoSQL key-value store optimized for large datasets of structured, non-relational data, not transient session state. While it can store data, it lacks native support for session management features like automatic expiration (Time-To-Live) and efficient locking mechanisms required for concurrent session updates. Its access patterns are not optimized for the high-frequency reads and writes typical of session state, potentially leading to increased latency compared to specialized caching solutions.
- ✗
Use a SQL Database to store session data.
Why it's wrong here
Using a SQL Database for session state is technically feasible, as it provides persistence and transactional integrity. However, it introduces significant overhead due to the relational model, schema validation, and disk I/O, which can lead to higher latency for every session read and write operation. This approach is generally more expensive and less performant than dedicated in-memory data stores, particularly under high load, as SQL databases are not optimized for the rapid, transient key-value access patterns of session data.
- ✗
Use the in-memory session state provider.
Why it's wrong here
The in-memory session state provider stores session data directly within the web server's process memory. This approach offers the fastest access but is inherently non-scalable and non-durable. Any application restart, deployment, or server failure will result in the complete loss of all active session data. Furthermore, in a multi-instance or load-balanced environment, sessions are not shared across different server instances, leading to "sticky session" requirements or session loss when a user's request is routed to a different server.
- ✓
Use Azure Redis Cache as a session state provider.
Why this is correct
Azure Redis Cache is an in-memory data store based on the open-source Redis project, specifically designed for high-performance caching and session state management. It offers extremely low-latency access, supports data persistence (optional), and provides built-in features like automatic expiration (Time-To-Live) for session keys. Its distributed nature allows session data to be shared across multiple application instances, ensuring scalability and high availability, making it an ideal choice for robust and performant web applications.
Go deeper
Related to this question
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.