-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lab-08 PartitionKey error #54
Comments
Ok, so the fix is when you are creating a container in the portal, make sure the partition key is set to /Item. You will need to create the database and the container manually. |
Hi Daniel, Unfortunately that didnt work for me. Do you have any other solution. If I dont pass the partionkey to the CreateItemAsync method. It works. But I wanted to make work with passing Partitionkey Matt |
One more thing, I get only the exception reason code as "Response status code does not indicate success: 400 Substatus: 1001 Reason: ()." |
Hey Mathews, Is your reason blank in the error code? You might need to do /YourPartitionKeyNameHere. If that doesn't work, do you have a snippet of code? |
Thanks Daniel for reaching out. I figured out the weird scenario. my partition key was defined as /PostCode which throws error while the Partition key /Postcode works. Not sure why MS is so particular abt case. Note : On container it was defined as /Postcode |
Unhandled Exception: Microsoft.Azure.Cosmos.CosmosException: Response status code does not indicate success: 400 Substatus: 1001 Reason: (Microsoft.Azure.Documents.BadRequestException: Message: {"Errors":["PartitionKey extracted from document doesn't match the one specified in the header"]}
No matter what approach I take, no matter how much I research, I still am getting this error. I updated to the latest nuget package for CosmosDB, still getting this error.
I cannot continue the lab without this step.
The text was updated successfully, but these errors were encountered: