Open brandonh-msft opened 4 years ago
cc @sarah-aly
@brandonh-msft Thank you for your feedback! We have assigned this issue to the author to review further and take the right course of action.
+1. Agreed with @brandonh-msft .
It appears that the input binding examples have moved to https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2-input?tabs=csharp. The examples include the partition key, and a note indicating that if the collection is partioned, then a partition key is required.
Is there more to do on this feedback? @mike-urnun-msft @craigshoemaker
So actually I've just tried it just yesterday. I have a CosmosDb collection partitioned on /nameOfField, and no-matter what I do in an output binding:
It always inserts the new record.
Interestingly, when inserting with LogicApps, there has to be an header with the VALUE of the partition key (not the path), and it has to be the same as the one on the request payload. As to functions, I have no idea how this works.
Also the documentation page says: "PartitionKey | When CreateIfNotExists is true, it defines the partition key path for the created collection." but this could be made clearer. I'm seeing several examples on the web and even in a book where the pk value is passed here instead of the "key path". For example:
and
https://dontcodetired.com/blog/post/Writing-Azure-Cosmos-DB-Data-from-Azure-Functions
Using the single-doc sample shown here will result in an HTTP 500 saying
PartitionKey
is required.I would advise re-assessment of all usages of the Cosmos binding shown in this doc.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.