exam questions

Exam AZ-303 All Questions

View all questions & answers for the AZ-303 exam

Exam AZ-303 topic 1 question 36 discussion

Actual exam question from Microsoft's AZ-303
Question #: 36
Topic #: 1
[All AZ-303 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. Delete Container1.
  • B. Create a new container in DB1.
  • C. Implement the Azure Cosmos DB.NET.SDK.
  • D. Regenerate the keys for Account1.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
The Change Feed Processor and Bulk Executor Library, in Azure Cosmos DB 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
czarul79
Highly Voted 4 years, 6 months ago
Warning ! on exam303 - Microsoft change the anwer since 18th january 2021 and removed option: B. Create a new container in DB1. NOW ! new B is option => "Create a new Azure Cosmos DB account" Propably there were to many mistakes , so go for new comments from HERE pos
upvoted 67 times
kuroro
4 years, 4 months ago
Is new B the correct answer?
upvoted 5 times
Moyuihftg
4 years, 2 months ago
Yes it is
upvoted 4 times
...
...
...
anandpsg101
Highly Voted 4 years, 8 months ago
we need to create new container with new partition. and move the data from old container and delete the old container.
upvoted 26 times
...
syu31svc
Most Recent 3 years, 11 months ago
Technically, it is not possible to “update” your partition key in an existing container. So, create new container with new partition key and move the data from old container and then delete the old container. https://devblogs.microsoft.com/cosmosdb/how-to-change-your-partition-key/ B is correct
upvoted 4 times
...
Amit3
4 years, 1 month ago
On Exam 11-Jun-21, Answer is correct.
upvoted 3 times
...
nfett
4 years, 2 months ago
refer to "Choosing a partition key" from https://docs.microsoft.com/en-us/azure/cosmos-db/partitioning-overview#choose-partitionkey B is the right answer for this.
upvoted 4 times
...
azurellc
4 years, 2 months ago
On exam 5/15/2021
upvoted 4 times
...
VivekSood
4 years, 3 months ago
So as per new MS option. What is the right answer? is it still option 'B' Create a new Azure Cosmos DB account ?
upvoted 2 times
...
kaunhe
4 years, 3 months ago
like czarul says" "on exam303 - Microsoft change the answer since 18th january 2021 and removed option: B. Create a new container in DB1. NOW ! new B is option => "Create a new Azure Cosmos DB account"
upvoted 2 times
JayBee65
3 years, 6 months ago
Are you saying that the new answer B is correct? I think you are, but it's not clear from your post.
upvoted 1 times
...
...
AKumar
4 years, 4 months ago
was in the exam, New option in place B="Create a new Azure Cosmos DB account"
upvoted 5 times
...
Stevezzc
4 years, 6 months ago
Correct. Once you select your partition key, it is not possible to change it in-place. If you need to change your partition key, you should move your data to a new container with your new desired partition key. see also: https://docs.microsoft.com/en-us/azure/cosmos-db/partitioning-overview#choose-partitionkey
upvoted 3 times
...
azurecert2021
4 years, 6 months ago
it looks like DB account and DB can be same only source and destination collection container should be different as shown in dev blog screenshot. but we can not delete the container1 as we have to migrate the data or copy from it , other options are totally irrelevant hence give option is correct "creating a new Cosmo DB account" it can be same of different so given answer is correct and justification mentioned is from dev blog from Theo who is Program Manager, Azure Cosmos DB same as Q63 only options are different there correct option is "Create a new Azure Cosmos DB account." similar question in 300 dumps except correct option is different Create a new container in DB1. rest of the option was same as this question
upvoted 3 times
levo017
4 years, 5 months ago
Thank you ~
upvoted 1 times
...
...
azurecert2021
4 years, 6 months ago
2) dev blog from Theo who is Program Manager, Azure Cosmos DB =>https://devblogs.microsoft.com/cosmosdb/how-to-change-your-partition-key/ 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”. You will need to have access to an Azure subscription, and an Azure Cosmos DB SQL API account that will be used for the migration metadata (this can be the same as the collection where you wish to change partition key scheme, if you wish). The deployment uses Azure Resource Manager (ARM) to deploy two app service plans. One is for a client node.js application, and the other is to handle the migration workload and Change Feed processing.
upvoted 1 times
...
azurecert2021
4 years, 6 months ago
There are 2 site 1) microsoft site https://docs.microsoft.com/en-us/azure/cosmos-db/partitioning-overview Selecting your partition key is a simple but important design choice in Azure Cosmos DB. Once you select your partition key, it is not possible to change it in-place. If you need to change your partition key, you should move your data to a new container with your new desired partition key.
upvoted 3 times
...
MadhaviSalunkhe
4 years, 8 months ago
Given answer is correct. No need to delete container1 as per given documents
upvoted 2 times
...
Suseel
4 years, 8 months ago
Answer should be A
upvoted 1 times
Jindrich
4 years, 5 months ago
So you lose all your data? Would not be better to create a new container first, define the new partition and then move the data and then delete the container?
upvoted 6 times
...
...
xAlx
4 years, 8 months ago
Correct You cannot update partition key, need to create new container and re-populate data
upvoted 10 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 ...