nerdexam
Microsoft

DP-420 · Question #54

While working in .NET SDK v3, you need to enable multi-region writes in your app that uses Azure Cosmos DB. WestUS2 is the region where your application would be deployed and Cosmos DB is…

The correct answer is A. ApplicationRegion. The correct answer is A: ApplicationRegion. In the Azure Cosmos DB .NET SDK v3, you configure the preferred region for the client by setting the ApplicationRegion property on CosmosClientOptions. This tells the SDK to route both reads and writes to the specified region (WestUS2…

Optimize an Azure Cosmos DB solution

Question

While working in .NET SDK v3, you need to enable multi-region writes in your app that uses Azure Cosmos DB. WestUS2 is the region where your application would be deployed and Cosmos DB is replicated. Which of the following attributes would you set to WestUS2 to achieve the goal?

Options

  • AApplicationRegion
  • BSetCurrentLocation
  • CsetPreferredLocations
  • Dconnection_policy.PreferredLocations

How the community answered

(37 responses)
  • A
    92% (34)
  • B
    3% (1)
  • D
    5% (2)

Explanation

The correct answer is A: ApplicationRegion. In the Azure Cosmos DB .NET SDK v3, you configure the preferred region for the client by setting the ApplicationRegion property on CosmosClientOptions. This tells the SDK to route both reads and writes to the specified region (WestUS2 in this case), enabling the application to take advantage of multi-region write capabilities with low latency. Option B (SetCurrentLocation) is not a valid SDK v3 property. Option C (setPreferredLocations) is the method name used in older SDK versions (v2) or in other language SDKs such as Java. Option D (connection_policy.PreferredLocations) is the Python SDK pattern, not the .NET SDK v3 approach.

Topics

#Azure Cosmos DB SDK#Multi-region accounts#ApplicationRegion#.NET

Community Discussion

No community discussion yet for this question.

Full DP-420 Practice