Azure Cosmos DB Development Flashcards
7 cards from real Microsoft Certified: Azure Developer Associate practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Azure Cosmos DB Development flashcards as text
Which method in the Azure Cosmos DB .NET SDK v3 is used to create or replace an item if it already exists?
Answer: UpsertItemAsync
UpsertItemAsync creates the item if it does not exist or replaces it if it does, making it idempotent for create-or-update scenarios.
In Azure Cosmos DB SQL API queries, which clause is required when querying across all partitions?
Answer: ENABLE CROSS PARTITION QUERY
When executing a cross-partition query via the SDK, you must set EnableCrossPartitionQuery = true in QueryRequestOptions; without a partition key filter, queries fan out to all partitions.
What is the Azure Cosmos DB change feed?
Answer: A sorted list of changes to items in a container that can be read by consumers
The change feed is a persistent log of changes (inserts and updates) to items in a Cosmos DB container, readable in order by partition key within each partition.
Which of the following is a correct way to read a single item by its ID in Azure Cosmos DB .NET SDK v3?
Answer: container.ReadItemAsync(id, new PartitionKey(pk))
ReadItemAsync requires both the item ID and partition key value and is the most efficient single-item read (a point read costing 1 RU).
Which indexing policy mode in Azure Cosmos DB indexes all paths by default?
Answer: Consistent
Consistent indexing (the default) synchronously indexes all item paths on every write, enabling immediate query consistency.
What is the purpose of a stored procedure in Azure Cosmos DB?
Answer: To execute a batch of operations as an ACID transaction within a single partition
Stored procedures in Cosmos DB are JavaScript functions executed server-side and provide ACID transaction guarantees, but only within a single logical partition.
In Azure Cosmos DB, what NuGet package is used for the modern .NET SDK v3?
Answer: Microsoft.Azure.Cosmos
The Microsoft.Azure.Cosmos NuGet package is the official v3 SDK for .NET, replacing the older Microsoft.Azure.DocumentDB package.