Microsoft Azure Developer Associate AZ-204 Practice Question
You are developing a .NET 6 web API that must retrieve a very large dataset from an Azure Cosmos DB container. The code must stream results in pages of 100 items, automatically handle continuation tokens, and avoid loading the full result set into memory. Which SDK approach should you choose to meet these requirements?
Use CosmosClient.CreateFeedIterator() to obtain a FeedIterator and iterate over it without specifying MaxItemCount.
Execute a stored procedure by using Container.Scripts.ExecuteStoredProcedureAsync() and return the full query results in a single response.
Invoke a nonexistent Container.ReadAllItemsAsync() method to download every document, then process the results in memory.
Call Container.GetItemQueryIterator() with MaxItemCount = 100 and loop through the returned FeedIterator using ReadNextAsync().
The Container.GetItemQueryIterator() method of the Azure Cosmos DB .NET SDK v3/v4 returns a FeedIterator. By setting QueryRequestOptions with MaxItemCount = 100 and repeatedly calling ReadNextAsync() on the iterator, the application retrieves results page-by-page, streaming data and transparently processing continuation tokens. ReadAllItemsAsync() would attempt to load the entire container into memory (and does not exist in the SDK), stored procedures return the response in a single payload, and CosmosClient does not expose a CreateFeedIterator() method, so those alternatives do not satisfy the stated constraints.
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 continuation token in Azure Cosmos DB?
Open an interactive chat with Bash
What is the purpose of MaxItemCount in the QueryRequestOptions?
Open an interactive chat with Bash
How does FeedIterator<T> work in Azure Cosmos DB SDK?
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 .