cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Prasanjeet
New Member

Cosmos DB Error: PartitionKey extracted from document doesn't match the one specified in the header

I am creating a flow which is triggered by a dashboard tile and the action is to write tile data to Azure Cosmos DB collection. 

The collectionis partitioned by and ID which is an integer field.

Even though I provided the partition key value in "Partition key value" field, it always throws the following error:

{
"code": "BadRequest",
"message": "Message: {\"Errors\":[\"PartitionKey extracted from document doesn't match the one specified in the header\"]}\r\nActivityId: 1b0eb91a-6479-431c-8b26-3c57da3cfe64, Request URI: /apps/9fafd838-06d1-49bc-a854-8aa18a214421/services/78d4e987-0be0-4e26-abb3-22dbbb60f06a/partitions/108373ab-2e88-4ed7-9fd2-5367d13369be/replicas/131891964029515465p/, RequestStats: \r\nRequestStartTime: 2018-12-14T18:58:51.7746339Z, Number of regions attempted: 1\r\n, SDK: Microsoft.Azure.Documents.Common/2.1.0.0"
}
 
Also the header does not have "x-ms-documentdb-partitionkey" in it.
Any help resolving this would be appreciated.
Thanks.
4 REPLIES 4
v-bacao-msft
Community Support
Community Support

Hi @Prasanjeet,

 

Could you please share a full screenshot of the configuration of your flow?

Could you provide more details about Azure Cosmos DB collection configuration?

Please provide more details about configuration and we may provide a workaround for you.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GabrielStJohn
Microsoft
Microsoft

Hey, @Prasanjeet!

Thank you for posting on the Flow Community Forum! It appears as though @v-bacao-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



vijayvelaga
New Member

For x-ms-documentdb-partitionkey value you would need to specify the partition key value ("1234") and not the partition key attribute ("id").

x-ms-documentdb-partitionkey: [ "1234" ]

Once you do this, documents matching this partition key value will be returned.

this tbh, thanks!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (996)