AZ-204 Develop for Azure storage Practice Question
You are developing an application that reads data from Azure Table Storage. The application must retrieve all entities for a specific partition key. Which query approach is the most efficient?
⚠ Common exam trap
A common mix-up: candidates assume filtering on both PartitionKey and RowKey is the most efficient, but that retrieves only a single entity, not all entities for a partition, while filtering on PartitionKey alone is the correct and most efficient approach for retrieving all entities in a partition.
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
✓
Query with a filter on PartitionKey only.
In Azure Table Storage, the PartitionKey is the primary index for partitioning data. Querying with a filter on PartitionKey only allows the service to perform a partition scan, which is the most efficient way to retrieve all entities within a single partition because it avoids cross-partition queries and leverages the partition-level index directly.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Query with a filter on RowKey only.
Why it's wrong here
Azure Table Storage is inherently partitioned by the PartitionKey. A query filtered solely on RowKey without specifying the PartitionKey will result in a full table scan across all physical partitions. This is highly inefficient and costly, as the service must examine every partition to locate entities with the matching RowKey, leading to increased latency and higher transaction costs.
- ✗
Query with a filter on both PartitionKey and RowKey.
Why it's wrong here
Filtering on both PartitionKey and RowKey provides the most efficient lookup for a single specific entity in Azure Table Storage, as it directly targets the exact storage location. However, if the goal is to retrieve all entities belonging to a particular PartitionKey, adding a RowKey filter is unnecessary and restrictive. This approach would prevent the retrieval of the full set of entities within that partition, as it would only return a single entity if a specific RowKey is provided.
- ✗
Query all entities and filter in application code.
Why it's wrong here
Retrieving all entities from Azure Table Storage and then filtering them in application code is an extremely inefficient and costly approach that should be avoided. This method incurs significant network overhead by transferring potentially massive amounts of unnecessary data across the wire. It also consumes excessive application memory and wastes compute resources on filtering, leading to high latency and increased operational costs, particularly as the table size grows.
- ✓
Query with a filter on PartitionKey only.
Why this is correct
Filtering a query solely on the PartitionKey is the most efficient and recommended method for retrieving all entities within a specific partition in Azure Table Storage. This approach allows the service to directly access the targeted partition, which is stored contiguously, minimizing scan operations and maximizing read performance. It leverages the primary indexing mechanism, ensuring fast and cost-effective data retrieval for a partition's contents.
Go deeper
Related to this question
About these practice questions
One of 881 original AZ-204 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 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.