Microsoft Azure Developer Associate AZ-204 Practice Question
You are developing an Azure Functions app that reads individual orders from an Azure Cosmos DB Core (SQL) API database. During each function execution you know both the orderId (stored in the id property) and the customerId (used as the partition key). You must retrieve the matching item using the least possible request units and the lowest latency. Which method of the Azure Cosmos DB .NET SDK v3 should you call?
Container.UpsertItemAsync(order)
Container.GetItemQueryIterator<Order>(new QueryDefinition("SELECT * FROM c WHERE c.id = @id").WithParameter("@id", orderId))
The most efficient operation is a point read that specifies both the item's id and its partition key. In the .NET SDK v3 you perform a point read with ReadItemAsync. A point read costs only 1 RU and avoids the query processing pipeline, giving the lowest latency. Query iterator methods execute a query, which is more expensive and slower, even when the filter matches a single item. UpsertItemAsync both reads and writes data, so it performs additional work and incurs higher cost.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a partition key in Azure Cosmos DB?
Open an interactive chat with Bash
Why is the ReadItemAsync<T> method more efficient than executing a query?
Open an interactive chat with Bash
What are Request Units (RUs) in Azure Cosmos DB?
Open an interactive chat with Bash
Microsoft Azure Developer Associate AZ-204
Develop for Azure storage
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .