I have a bit of a problem using Microsoft.Azure.Cosmos version 3.2.0,
upon running
await this.Container.CreateItemAsync(logEntity, new
I've overlooked that when I have created the container
this.Container = await this.Database.CreateContainerIfNotExistsAsync("testContainer", "/id");
I have specified partitionKeyPath
as beeing the /id
.
It also seems that the partition key must reside on the object and must have a json property of partitionKeyPath property name without / like:
[JsonProperty(PropertyName = "partition")]
public string Partition { get; set; }
if partitionKeyPath
is /partition
this.Container = await this.Database.CreateContainerIfNotExistsAsync("testContainer", "/partition");
Sorry if this is obvious, I have just started playing around with CosmoDb.