AZ-204 Practice Question: Connect to and consume Azure services and third-party services
You are developing a web application that uses Azure Cosmos DB for NoSQL. You need to perform a point read by document ID and partition key. Which API method should you use to achieve the best performance and lowest cost?
⚠ Common exam trap
Watch out — candidates often assume a SQL query with a filter by ID is equivalent to a point read, but they overlook that the query engine always adds extra RU overhead and latency compared to the direct `ReadItemAsync` method.
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
✓
Call ReadItemAsync with the partition key and document ID.
The `ReadItemAsync` method is the most efficient way to perform a point read in Azure Cosmos DB for NoSQL because it directly accesses the document by its partition key and ID, using the resource ID (self-link) for a single request unit (RU) cost of exactly 1 RU for a 1 KB document. This bypasses the query engine entirely, providing the lowest latency and cost.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Call ReadItemAsync with the partition key and document ID.
Why this is correct
Calling ReadItemAsync with the partition key and document ID is the most efficient and cost-effective method for retrieving a single item in Azure Cosmos DB. This operation is known as a point read, which directly accesses the physical partition where the item resides, bypassing the more resource-intensive query engine. It consumes the fewest Request Units (RUs) because it's a direct key-value lookup, making it ideal for scenarios requiring high performance and low latency for single-item retrieval.
- ✗
Call QueryAsync with a SQL query that filters by ID.
Why it's wrong here
Calling QueryAsync with a SQL query that filters by ID is less efficient than a point read for retrieving a single item. Even when filtering by a specific ID, this operation still invokes the Cosmos DB query engine, which involves index lookups and potentially scanning across partitions if the partition key is not included in the query or the index is not optimal. Consequently, it consumes significantly more Request Units (RUs) compared to a direct ReadItemAsync call, making it a suboptimal choice for retrieving a known single item.
- ✗
Call CreateItemAsync and check for conflict.
Why it's wrong here
Calling CreateItemAsync and checking for a conflict is an incorrect approach for reading an existing item. The CreateItemAsync method is exclusively designed for inserting new documents into a Cosmos DB container. While it can return a conflict error if an item with the same ID and partition key already exists, this mechanism is intended for optimistic concurrency control during the creation process, not for retrieving data. Misusing it for a read operation would be highly inefficient, misleading, and semantically incorrect.
- ✗
Call ReadManyAsync with a list of IDs.
Why it's wrong here
Calling ReadManyAsync with a list of IDs is not the most appropriate method for retrieving a single item. ReadManyAsync is optimized for fetching multiple items efficiently in a single batch request, provided a list of item IDs and their corresponding partition keys. Although it could technically be used with a list containing only one ID, it introduces unnecessary overhead compared to ReadItemAsync, which is specifically designed and highly optimized for the direct retrieval of a single, known item.
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.