azure-webjobs-sdk-extensions icon indicating copy to clipboard operation
azure-webjobs-sdk-extensions copied to clipboard

Lack of database triggers in CosmosDB binding

Open rmaziarka opened this issue 6 years ago • 3 comments

Hello,

Currently, Azure Functions bindings to CosmosDB are lacking options to specify database triggers names, which should be run while inserting / updating a document.

Will you consider joining PR if I add such option to CosmosDB binding?

rmaziarka avatar Jul 16 '18 08:07 rmaziarka

@rmaziarka Keep in mind that the Output Binding has two was of working, one with a single document using an out variable (there are really not many options there) and the other with the IAsyncCollector to save multiple, but in that case you have to deal with the fact that the IAsyncCollector interface is used by all Output Bindings (not just Cosmos DB).

ealsur avatar Jul 19 '18 12:07 ealsur

@ealsur but isn't it using the same CosmosDBService? I could find out how to pass properly database triggers' params to this service from an attribute.

rmaziarka avatar Jul 19 '18 13:07 rmaziarka

That's a good alternative yeah. Just keep in mind that it would apply to all operations (maybe you want some Upserts to run the triggers and some not).

ealsur avatar Jul 19 '18 13:07 ealsur