Function1.cs 993 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using Microsoft.Azure.Documents;
  4. using Microsoft.Azure.WebJobs;
  5. using Microsoft.Azure.WebJobs.Host;
  6. using Microsoft.Extensions.Logging;
  7. namespace TEAMModelOSFunction
  8. {
  9. public static class Function1
  10. {
  11. [FunctionName("Function1")]
  12. public static void Run([CosmosDBTrigger(
  13. databaseName: "TEAMModelOS",
  14. collectionName: "Teacher",
  15. ConnectionStringSetting = "AccountEndpoint=https://cdhabookdep-free.documents.azure.cn:443/;AccountKey=JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==;",
  16. LeaseCollectionName = "leases")]
  17. 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. }
  27. }