0
votes

Is there any way that we can add Partition Keys for the Collections we already have in Azure-Cosmos DB, or we need to drop them and create new collections with partition keys and import the data from the previous collections?

I tried googling a lot and checking the settings of the collection but nothing helped. if you could that would be great, thanks in advance.

1

1 Answers

0
votes

Once created, a collections partition key definition cannot change. This means that you cannot add, remove or alter the partition key of a collection once created. You can use the Cosmos DB change feed to migrate to a new collection with the appropriate partition key.