-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonUserSavedTrigger.cs
More file actions
29 lines (28 loc) · 887 Bytes
/
Copy pathonUserSavedTrigger.cs
File metadata and controls
29 lines (28 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using Microsoft.Azure.Documents;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;
namespace DeevCorp.Function
{
public static class onUserSavedTrigger
{
[FunctionName("onUserSavedTrigger")]
public static void Run(
[CosmosDBTrigger(
databaseName: "BirthdayWishes",
collectionName: "Users",
ConnectionStringSetting = "CosmosDBConnection",
LeaseCollectionName = "leases",
CreateLeaseCollectionIfNotExists = true)]
IReadOnlyList<Document> users,
ILogger log)
{
if (users != null && users.Count > 0)
{
log.LogInformation("A new user document has been created" + users[0]);
}
}
}
}