exam questions

Exam AZ-300 All Questions

View all questions & answers for the AZ-300 exam

Exam AZ-300 topic 16 question 29 discussion

Actual exam question from Microsoft's AZ-300
Question #: 29
Topic #: 16
[All AZ-300 Questions]

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?

  • A. Regenerate the keys for Account1.
  • B. Create a new container in DB1.
  • C. Delete Container1.
  • D. Implement the Azure Cosmos DB .NET SDK.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
The good news is that there are two features, the Change Feed Processor and Bulk Executor Library, in Azure Cosmos DB that can be leveraged to achieve a live migration of your data from one container to another. This allows you to re-distribute your data to match the desired new partition key scheme, and make the relevant application changes afterwards, thus achieving the effect of "updating your partition key".
Incorrect Answers:
A: It is not possible to "update" your partition key in an existing container.
Reference:
https://devblogs.microsoft.com/cosmosdb/how-to-change-your-partition-key/

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
boras
4 years, 8 months ago
Shouldn't we first remove the existing container?
upvoted 4 times
ihustle
4 years, 7 months ago
The good news is that there are two features, the Change Feed Processor and Bulk Executor Library, in Azure Cosmos DB that can be leveraged to achieve a live migration of your data from one container to another. This allows you to re-distribute your data to match the desired new partition key scheme, and make the relevant application changes afterwards, thus achieving the effect of “updating your partition key”. So you should not delete the old container
upvoted 2 times
...
...
mcitp
4 years, 9 months ago
Correct, there's no way to update the partition key, once it has been created. You will need to create a new container. https://devblogs.microsoft.com/cosmosdb/how-to-change-your-partition-key/
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...