This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bindings": [ | |
{ | |
"type": "cosmosDBTrigger", | |
"name": "input", | |
"direction": "in", | |
"databaseName": "<name-of-your-monitored-database>", | |
"collectionName": "<name-of-your-monitored-collection>", | |
"connectionStringSetting": "<name-of-connection-string-setting>", | |
"leaseCollectionName": "leases", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bindings": [ | |
{ | |
"type": "cosmosDBTrigger", | |
"name": "input", | |
"direction": "in", | |
"databaseName": "<name-of-your-monitored-database>", | |
"collectionName": "<name-of-your-monitored-collection>", | |
"connectionStringSetting": "<name-of-connection-string-setting>", | |
"leaseCollectionName": "leases", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"frameworks": { | |
"net46":{ | |
"dependencies": { | |
"Microsoft.Azure.Search": "3.0.5" | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "john", | |
"born": "1983-05-07", | |
"id": "f08cfd6b-303e-654b-9c49-41a47ebbeae7" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "Microsoft.Azure.Documents.Client" | |
using System; | |
using System.Configuration; | |
using System.Collections.Generic; | |
using Microsoft.Azure.Documents; | |
using Microsoft.Azure.Search; | |
private static string searchServiceName = ConfigurationManager.AppSettings["SearchServiceName"]; | |
private static string searchServiceKey = ConfigurationManager.AppSettings["SearchServiceKey"]; | |
private static SearchServiceClient serviceClient = new SearchServiceClient(searchServiceName, new SearchCredentials(searchServiceKey)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bindings": [ | |
{ | |
"type": "cosmosDBTrigger", | |
"name": "input", | |
"direction": "in", | |
"leaseCollectionName": "leases", | |
"connectionStringSetting": "<your-connectionstring-setting>", | |
"databaseName": "<your-monitored-database>", | |
"collectionName": "<your-monitored-collection>", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bindings": [ | |
{ | |
"type": "cosmosDBTrigger", | |
"name": "input", | |
"direction": "in", | |
"leaseCollectionName": "leases", | |
"connectionStringSetting": "<your-connectionstring-setting>", | |
"databaseName": "<your-monitored-database>", | |
"collectionName": "<your-monitored-collection>", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"documentDB": { | |
"connectionMode": "Direct", | |
"protocol": "Tcp" | |
} | |
} |