cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Prasanjeet
Level: Power Up

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.
3 REPLIES 3
Community Support Team
Community Support Team

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

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.
Highlighted
Administrator
Administrator

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

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
Microsoft Flow Community Manager
vijayvelaga
Level: Power Up

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

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.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 49 members 4,889 guests
Please welcome our newest community members: