Microsoft Azure Architect Technologies (legacy) — Question 77
You have an Azure Cosmos DB account named Account1. Account1 includes a database named DB1 that contains a container named Container1. The partition key for Container1 is set to /city.
You plan to change the partition key for Container1.
What should you do first?
Answer options
- A. Regenerate the keys for Account1.
- B. Create a new container in DB1.
- C. Delete Container1.
- D. Implement the Azure Cosmos DB .NET SDK.
Correct answer: B
Explanation
To change the partition key for a container in Azure Cosmos DB, the first step is to create a new container because existing containers cannot have their partition keys altered. Regenerating the keys, deleting the container, or implementing the SDK do not directly address the need to change the partition key.