Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cosmos DB in Azure Functions V1 and V2
...
using Microsoft.Azure.Documents;
...
namespace CosmosDb.NetFramework.FunctionApp
{
public static class UpsertProductCosmosDbTrigger
{
[FunctionName("ProductUpsertCosmosDbTrigger")]
public static void Run(
[CosmosDBTrigger(
// Those names come from the application settings.
// Those names can come with both preceding % and trailing %.
databaseName: "CosmosDbDdatabaseName",
collectionName: "CosmosDbCollectionName",
LeaseDatabaseName = "CosmosDbDdatabaseName",
LeaseCollectionName = "CosmosDbLeaseCollectionName")] IReadOnlyList<Document> input,
TraceWriter log)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment