Skip to content

Instantly share code, notes, and snippets.

@sjwaight
Created October 28, 2020 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjwaight/d04554b64ca88e9781004315a35baf83 to your computer and use it in GitHub Desktop.
Save sjwaight/d04554b64ca88e9781004315a35baf83 to your computer and use it in GitHub Desktop.
Simple C# Azure Function show Trigger and Output Binding
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