Cosmos DB x-ms-partitionkey Error

If you're looking for help with C#, .NET, Azure, Architecture, or would simply value an independent opinion then please get in touch here or over on Twitter.

A small tip but one might save you some time – if you’re trying to run Cosmos DB queries via the REST API you might encounter the following Bad Request error:

The partition key supplied in x-ms-partitionkey header has fewer components than defined in the the collection.

What you actually need to specify is the partition key for your collection using the x-ms-documentdb-partitionkey header.

An annoyingly misleading error message!

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact

  • If you're looking for help with C#, .NET, Azure, Architecture, or would simply value an independent opinion then please get in touch here or over on Twitter.

Recent Posts

Recent Tweets

  • Been stopped multiple times for checks in the airport this morning. My sad face must look like my suspicious face!
  • My summer cycling mission is to nail my nutrition. I know what works for weight training but other than “more carb… https://t.co/Xo83puK5AO
  • Really struggling with the idea of leaving. It gets harder every time. Remembering that I get to see my awesome fr… https://t.co/t4KL8ZWBXV
  • RT @swardley: The best advert for serverless that I'm aware of is ... every Kubernetes presentation ever given.

Recent Comments

Archives

Categories

Meta

GiottoPress by Enrique Chavez