-
Notifications
You must be signed in to change notification settings - Fork 4
/
FileParser.cs
32 lines (29 loc) · 1.09 KB
/
FileParser.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
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 FileParser
{
private readonly ILogger _logger;
public FileParser(ILogger<FileParser> logger)
{
_logger = logger;
}
[Function("FileParser")]
public void Run([BlobTrigger("pickup/{name}", Connection = "AzureWebJobsStorage")] Stream myBlob, string name)
{
string ApiKeyName = "x-api-key";
_logger.LogInformation("C# blob trigger function processed a request.");
NameValueCollection nvc = new NameValueCollection();
nvc.Add(ApiKeyName, "43EFE991E8614CFB9EDECF1B0FDED37A");
nvc.Add("ContainerName", name);
IOrchestrationService orchrestatorService = new ManagedOrchestratorService(nvc);
var processFiles = orchrestatorService.Run(myBlob);
_logger.LogInformation(processFiles);
}
}
}