Free DP-420 Exam Braindumps
Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB Questions 1–43 (page: 28)

Updated On: 16-Nov-2026
View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure subscription. The subscription contains an Azure Cosmos DB for NoSQL account named account1 that hosts a container named Customers. Multi-region writes are allowed.
You execute the following C# code.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: Yes
Yes - Conflict is the ID of the stored procedure used for conflict resolution
With multi-region writes, when multiple clients write to the same item, conflicts may occur.
When a conflict occurs, you can resolve the conflict by using different conflict resolution policies.
Create a custom conflict resolution policy using a stored procedure
These samples show how to set up a container with a custom conflict resolution policy. This policy uses the logic in a stored procedure to resolve the conflict. If a stored procedure is designated to resolve conflicts, conflicts won't show up in the conflict feed unless there's an error in the designated stored procedure.
Example:
DocumentCollection udpCollection = await createClient.CreateDocumentCollectionIfNotExistsAsync( UriFactory.CreateDatabaseUri(this.databaseName), new DocumentCollection
{
Id = this.udpCollectionName,
ConflictResolutionPolicy = new ConflictResolutionPolicy
{
Mode = ConflictResolutionMode.Custom,
ConflictResolutionProcedure = string.Format("dbs/{0}/colls/{1}/sprocs/{2}", this.databaseName, this.udpCollectionName, "resolver"),
},
});
//Create the stored procedure await clients[0].CreateStoredProcedureAsync(
UriFactory.CreateStoredProcedureUri(this.databaseName, this.udpCollectionName, "resolver"), new StoredProcedure
{
Id = "resolver",
Body = File.ReadAllText(@"resolver.js")
});
Box 2: Yes
Yes - When a write conflict occurs, the id property of items in customers will hold the session token of the last writer.
Box 3: No
No - Changing the conflict resolution policy for customer to LastWriterWins requires dropping the container.
ConflictResolutionPolicy.ResolutionProcedure Property
Gets or sets the Stored Procedure which is used for conflict resolution in the Azure Cosmos DB service. This stored procedure may be created after the CosmosContainer is created and can be changed as required.
Syntax:
public string ResolutionProcedure { get; set; }
Property Value
String
The stored procedure to perform conflict resolution.
Examples conflictResolutionPolicy.ConflictResolutionProcedure = "dbs/databaseName/colls/containerName/sprocs/storedProcedureName";


Reference:

https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-manage-conflicts https://learn.microsoft.com/en-us/dotnet/api/azure.cosmos.conflictresolutionpolicy.resolutionprocedure



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure Cosmos DB for NoSQL account named account1 in a resource group named RG1. The Azure regions for account1 are shown in the following table.

You need to fail over account1 from the East US region to the Central US region by using Azure Command-Line Interface (CLI).
How should you complete the command? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: failover-priority-change
# Initiate a manual failover and promote failoverLocation1 as primary write region echo "Failing over to $failoverLocation1"
az cosmosdb failover-priority-change --name $account --resource-group $resourceGroup --failover-policies "$location=2" "$failoverLocation1=0" "$failoverLocation2=1"
Box 2: --failover-policies


Reference:

https://learn.microsoft.com/en-us/azure/cosmos-db/scripts/cli/common/regions



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You are developing an application that will connect to an Azure Cosmos DB for NoSQL account. The account has a single read-write region and one additional read region. The regions are configured for automatic failover.
The account has the following connection strings. (Line numbers are included for reference only.)

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: No
The same connection string can still be used.
Azure Cosmos DB Core read write region connection strings
Azure Cosmos DB "primary write region" failover "connection string"
Box 2: No
The AccountEndpoint for both are the same.
Box 3: Yes
The ConnectionPolicy.PreferredLocations property gets and sets the preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. For example, "East US" as the preferred location.
When EnableEndpointDiscovery is true and the value of this property is non-empty, the SDK uses the locations in the collection in the order they are specified to perform operations, otherwise if the value of this property is not specified, the SDK uses the write region as the preferred location for all operations.


Reference:

https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.client.connectionpolicy.preferredlocatio ns



HOTSPOT (Drag and Drop is not supported)
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. The account hosts two containers named Customers and Sale Transactions. The Customers container stores customer data.
Each customer data item includes a field named numberOfSales that must be updated when an item is added to the SaleTransactions container.
You need to ensure referential integrity between the containers. The solution must meet the following requirements:
● Detect changes to the SaleTransactions container.
● Apply a new aggregate count to the related items in the Customers container.
What should you use to implement each requirement? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: A change feed
An Azure Cosmos DB change feed is the ideal solution for this scenario. It provides a reliable, scalable way to trigger actions when data changes.
Event-Driven: It automatically detects new sales items.
Guaranteed Order: It processes changes sequentially per logical partition.
Fault Tolerant: It tracks progress using a lease container.
Box 2: An Azure function
To apply the new aggregate count, you should use an Azure Function triggered by the Azure Cosmos DB Change Feed.
Cross-Container Operations: Change feeds process data asynchronously after writes occur. Azure Functions can read from the Sales container's change feed and seamlessly write updates to the completely separate Customers container.
No Execution Time Limits: Post-triggers have a strict, short execution time limit. Azure Functions can handle heavy batch processing or complex logic without timing out.
Resilience and Scaling: Azure Functions automatically retry on failures. They also scale out automatically as your change feed volume grows.
Incorrect:
Post-Trigger Limitations: Cosmos DB post-triggers are scoped only to the specific container where the operation occurs. They cannot reliably or easily perform cross-container transactions or updates.


Reference:

https://azurecosmosdb.github.io/labs/dotnet/labs/08-change_feed_with_azure_functions.html https://dev.to/willvelida/working-with-azure-cosmos-db-in-your-azure-functions-4ppp



You have an Azure Cosmos DB for NoSQL account that uses a custom conflict resolution policy. The account has a registered merge procedure that throws a runtime exception.
The runtime exception prevents conflicts from being resolved.
You need to use an Azure function to resolve the conflicts.
What should you use?

  1. a function that pulls items from the conflicts feed and is triggered by a timer trigger
  2. a function that receives items pushed from the change feed and is triggered by an Azure Cosmos DB trigger
  3. a function that pulls items from the change feed and is triggered by a timer trigger
  4. a function that receives items pushed from the conflicts feed and is triggered by an Azure Cosmos DB trigger

Answer(s): A



Viewing page 28 of 61
Viewing questions 136 - 140 out of 296 questions


Post your Comments and Discuss Microsoft DP-420 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!