-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSqlQueueTrigger.cs
34 lines (32 loc) · 1.15 KB
/
SqlQueueTrigger.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.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using System.Net.Http;
using Newtonsoft.Json;
using HtmlAgilityPack;
using System.Web;
using Microsoft.Azure.Storage.Blob;
using System.Linq;
namespace HvidevoldDevelopmentENK.GetPixelArt
{
public static class SqlQueueTrigger
{
[FunctionName("SqlQueueTrigger")]
public static async Task Run(
[QueueTrigger("sqlqueue", Connection = "AzureWebJobsStorage")] string myQueueItem,
[Blob("opengameart/{queueTrigger}")] CloudBlockBlob blob,
[Queue("imgqueue"), StorageAccount("AzureWebJobsStorage")] ICollector<string> imgs,
ILogger log)
{
log.LogInformation($"C# SqlQueueTrigger function processed: {myQueueItem}");
if (await blob.ExistsAsync() && blob.Properties.Length > 0) {
await Common.AfterUploadFile(myQueueItem, blob.Properties.Length, log, imgs);
}
}
}
}