Microsoft Azure Developer Associate AZ-204 Practice Question
You are building a .NET 6 worker that uses the Azure Cosmos DB .NET SDK v3. The container's partition key path is '/department'. For each message, the code must add the item if it is new or fully replace it when one with the same id and partition key exists, using a single request to minimize latency and RU consumption. Which Container method meets the requirement?
The UpsertItemAsync method combines create and replace semantics in one request. If an item with the specified id and partition key already exists, Cosmos DB replaces it; otherwise, the service creates a new item. Because only one round-trip is required, latency and RU consumption are minimized. CreateItemAsync fails when the item exists, ReplaceItemAsync throws when the item is missing (requiring an extra read), and PatchItemAsync cannot create a new document, returning 404 when the item is absent.
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 RU consumption in Azure Cosmos DB?
Open an interactive chat with Bash
Why is UpsertItemAsync<T> preferred over CreateItemAsync<T> and ReplaceItemAsync<T>?
Open an interactive chat with Bash
What is a partition key 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 .