Created
October 28, 2020 22:30
-
-
Save sjwaight/d04554b64ca88e9781004315a35baf83 to your computer and use it in GitHub Desktop.
Simple C# Azure Function show Trigger and Output Binding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Host; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.WindowsAzure.Storage.Blob; | |
namespace Siliconvalve.Demo | |
{ | |
public static class JpegUploadRouter | |
{ | |
[FunctionName("JpegUploadRouter")] | |
[return: Queue("images", Connection = "customserverless01_QUEUE")] | |
public static string Run([BlobTrigger("sampleuploads/{name}.jpg", Connection = "customserverless01_STORAGE")]Stream blobContent, string name, ILogger log) | |
{ | |
log.LogInformation($"Routing image file: {name}.jpg"); | |
// just return the filename. | |
return $"{name}.jpg"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment