-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSQLDBTrigger.cs
34 lines (31 loc) · 1.29 KB
/
SQLDBTrigger.cs
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
30
31
32
33
34
using System;
using System.Collections.Specialized;
using System.IO;
using Microsoft.Extensions.Logging;
using Xenhey.BPM.Core.Net8;
using Xenhey.BPM.Core.Net8.Implementation;
using Microsoft.Azure.Functions.Worker;
namespace AzureServiceBusToSQL
{
public class SQLDBTrigger
{
private readonly ILogger _logger;
public SQLDBTrigger(ILogger<SQLDBTrigger> logger)
{
_logger = logger;
}
[Function("SQLDBTrigger")]
public void Run([ServiceBusTrigger("request", "sqlmessage", Connection = "ServiceBusConnectionString")] string mySbMsg, Int32 deliveryCount, DateTime enqueuedTimeUtc, string messageId)
{
string ApiKeyName = "x-api-key";
_logger.LogInformation("C# blob trigger function processed a request.");
NameValueCollection nvc = new NameValueCollection();
nvc.Add(ApiKeyName, "43EFE991E8614CFB9EDECF1B0FDED37C");
IOrchestrationService orchrestatorService = new ManagedOrchestratorService(nvc);
var processFiles = orchrestatorService.Run(mySbMsg);
_logger.LogInformation($"EnqueuedTimeUtc={enqueuedTimeUtc}");
_logger.LogInformation($"DeliveryCount={deliveryCount}");
_logger.LogInformation($"MessageId={messageId}");
}
}
}