Skip to content

Instantly share code, notes, and snippets.

@ealsur
Created April 2, 2018 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ealsur/d843f421dfa724c4b5e45ecf2a6cd9c9 to your computer and use it in GitHub Desktop.
Save ealsur/d843f421dfa724c4b5e45ecf2a6cd9c9 to your computer and use it in GitHub Desktop.
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