I've got a really simple azure Function with a CosmosDbTrigger set up (taken nearly straight from the examples just as a minimal repro):
[FunctionName("ProcessEmail")]
public static void Run([CosmosDBTrigger("mydb", "mycollection")]IReadOnlyList<Document> documents, TraceWriter log)
{
log.Verbose("Documents modified " + documents.Count);
log.Verbose("First document Id " + documents[0].Id);
}
This was super simple to set up and works perfectly.
However, in my case I am only interested in being notified when a record is inserted - not when it is updated.
- Is it possible to have the trigger only occur when a document is inserted?
- If not, is it possible to tell, per-document, whether it was an insertion or an update that triggered this run?
- If not, what's my best option here? Have a flag on the document for whether or not this phase of it has been processed?