Function1.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text.Json;
  4. using Microsoft.Azure.Functions.Worker;
  5. using Microsoft.Azure.WebJobs;
  6. using Microsoft.Azure.WebJobs.Host;
  7. using Microsoft.Extensions.Logging;
  8. namespace TEAMModelOS.FunctionV4
  9. {
  10. public class Function1
  11. {
  12. //[FunctionName("Function1")]
  13. //public static void Run([CosmosDBTrigger(
  14. // databaseName: "TEAMModelOS",
  15. // collectionName: "Common",
  16. // ConnectionStringSetting = "Azure:Cosmos:ConnectionString",
  17. // LeaseCollectionName = "leases")]IReadOnlyList<Document> input,
  18. // ILogger log)
  19. //{
  20. // if (input != null && input.Count > 0)
  21. // {
  22. // log.LogInformation("Documents modified " + input.Count);
  23. // log.LogInformation("First document Id " + input[0].Id);
  24. // }
  25. // }
  26. [Function("Function1")]
  27. public void Run([CosmosDBTrigger(
  28. databaseName: "TEAMModelOS",
  29. containerName: "Common",
  30. Connection = "Azure:Cosmos:ConnectionString",
  31. LeaseContainerName = "leases",
  32. //LeaseContainerPrefix = "TEAMModelOS",
  33. CreateLeaseContainerIfNotExists =true)]IReadOnlyList<JsonElement> input,
  34. ILogger log)
  35. {
  36. if (input != null && input.Count > 0)
  37. {
  38. //log.LogInformation("Documents modified " + input.Count);
  39. //log.LogInformation("First document Id " + input[0].Id);
  40. }
  41. }
  42. }
  43. }