Have a simple Cosmos DB table using Table API, and am using the Python SDK. Successfully inserted entity using the class azure.cosmosdb.table.tableservice.TableService and the method insert_or_replace_entity.
But when I try to update it (using merge_entity or update_entity) it gives me this error (cleaned up the formatting, paraphrasing):
AzureMissingResourceHttpError: Not Found
{
"odata.error": {
"code": "ResourceNotFound",
"message": {
"lang": "en-us",
"value": "The specified resource does not exist. RequestID: [REDACTED]"
}
}
}
When I tried to instead use insert_or_merge_entity I get this error instead:
AzureHttpError: Bad Request
{
"odata.error": {
"code": "BadRequest",
"message": {
"lang": "en-us",
"value": "Requests originating from scripts cannot reference partition keys other than the one for which client request was submitted."
}
}
}
I assume Cosmos DB finds the match based on the combo of PartitionKey and RowKey, but I am including valid PKs and RKs and still failing. Anyone have a solution?
Also asked on Stack Overflow https://stackoverflow.com/questions/54352344
Data:
Problem:
Have a simple Cosmos DB table using Table API, and am using the Python SDK. Successfully inserted entity using the class
azure.cosmosdb.table.tableservice.TableService
and the methodinsert_or_replace_entity
.But when I try to update it (using
merge_entity
orupdate_entity
) it gives me this error (cleaned up the formatting, paraphrasing):When I tried to instead use
insert_or_merge_entity
I get this error instead:I assume Cosmos DB finds the match based on the combo of PartitionKey and RowKey, but I am including valid PKs and RKs and still failing. Anyone have a solution?
Googled to no avail, double checked docs https://docs.microsoft.com/en-us/rest/api/storageservices/update-entity2.