Misa Kovar
Misa Kovar

Reputation: 73

CosmosDB Container without PartitionKey

I'm using Azure Cosmos DB .NET SDK Version 3.0 and I want to create container programmatically without partition key. Is it possible? I always got error saying Value cannot be null. Parameter name: partitionKey

I use method CosmosContainers.CreateContainerIfNotExistsAsync

Upvotes: 5

Views: 6527

Answers (1)

Jay Gong
Jay Gong

Reputation: 23782

Reproduce your issue on my side always.

enter image description here

Notice the exception is caused by below method:

enter image description here

Try to deserialize the dll source code and find the detailed logical code.

enter image description here

It seems we can't cross this judgement so far because cosmos db team is planning to deprecate ability to create non-partitioned containers, as they do not allow you to scale elastically.(Mentioned in my previous case:Is it still a good idea to create comos db collection without partition key?

But you still could create non-partitioned containers with DocumentDB .net package or REST API.

Upvotes: 7

Related Questions