-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathFiledroptrigger.cs
More file actions
40 lines (32 loc) · 1.26 KB
/
Filedroptrigger.cs
File metadata and controls
40 lines (32 loc) · 1.26 KB
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
35
36
37
38
39
40
// Default URL for triggering event grid function in the local environment.
// http://localhost:7071/runtime/webhooks/EventGrid?functionName={functionname}
using Azure.Messaging.EventGrid;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System.Collections.Specialized;
using Xenhey.BPM.Core.Net8;
using Xenhey.BPM.Core.Net8.Implementation;
namespace AzureServiceBusToSQL;
public class Filedroptrigger
{
private readonly ILogger<Filedroptrigger> _logger;
private NameValueCollection nvc = new NameValueCollection();
public Filedroptrigger(ILogger<Filedroptrigger> logger)
{
_logger = logger;
}
[Function(nameof(Filedroptrigger))]
public void Run([EventGridTrigger] EventGridEvent eventGridEvent)
{
string ApiKeyName = "x-api-key";
_logger.LogInformation($"Received event: {eventGridEvent.EventType}");
NameValueCollection nvc = new NameValueCollection
{
{ ApiKeyName, "2484F9382E974133A216F8E39BF4C389" }
};
var input = JsonConvert.SerializeObject(eventGridEvent);
IOrchestrationService orchrestatorService = new RemoteOrchrestratorService(nvc);
var processFiles = orchrestatorService.Run(input);
}
}