Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Azure Cosmos DB + Functions Cookbook - multi triggers
[FunctionName("Trigger1")]
public static void Run(
[CosmosDBTrigger("<your-monitored-database>",
"<your-monitored-collection>",
ConnectionStringSetting = "<your-connectionstring-setting>"
LeaseCollectionPrefix = "trigger1")]
IReadOnlyList<Document> input,
TraceWriter log)
{
log.Info("Documents modified " + input.Count);
log.Info("First document Id " + input[0].Id);
}
[FunctionName("Trigger2")]
public static void Run(
[CosmosDBTrigger("<your-monitored-database>",
"<your-monitored-collection>",
ConnectionStringSetting = "<your-connectionstring-setting>"
LeaseCollectionPrefix = "trigger2")]
IReadOnlyList<Document> input,
TraceWriter log)
{
log.Info("Documents modified " + input.Count);
log.Info("First document Id " + input[0].Id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.