Function1.cs 1.5 KB

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