AI-102 Implement an agentic solution Practice Question
A developer is building an agent using the Microsoft Bot Framework SDK in C#. The agent must authenticate users via Microsoft Entra ID and maintain state across conversations. The solution must store user preferences (e.g., language, timezone) in Azure Cosmos DB. Which state management approach should the developer use?
⚠ Common exam trap
A common mix-up: candidates confuse UserState (persistent across conversations) with ConversationState (temporary per conversation), leading candidates to incorrectly choose ConversationState with Memory Storage, which loses data when the bot 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
✓
Use UserState with Cosmos DB Storage.
The developer needs to persist user preferences across conversations, which requires UserState (not ConversationState, which is scoped to a single conversation). Cosmos DB Storage is the appropriate choice for durable, scalable, and low-latency storage of user-specific data, and it integrates directly with the Bot Framework SDK's `CosmosDbPartitionedStorage` class.
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 the Bot State Service (deprecated).
Why it's wrong here
Bot State Service is deprecated and not recommended for new solutions.
- ✗
Use UserState with Blob Storage.
Why it's wrong here
Blob Storage is not optimized for small state objects; Cosmos DB is recommended.
- ✗
Use ConversationState with Memory Storage.
Why it's wrong here
Memory Storage is volatile and ConversationState is per-conversation, not per-user.
- ✓
Use UserState with Cosmos DB Storage.
Why this is correct
UserState persists user-specific data across conversations, and Cosmos DB is a scalable storage option.
Go deeper
Related to this question
About these practice questions
One of 945 original AI-102 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AI-102 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 AI-102 exam.