I create an Azure function that runs when an image is uploaded or added to a specific Azure storage, and it does the following: 1.) Resize the image 2.) Put the image in the correct directory (using output binding) 3.) Delete the original drop image that was added to the Azure repository after processing.
In this process, everything is done with steps 1 and 2, but I do not see any documentation about removing blob or APIs that will expose methods for Azure Storage. (Using C #)
Here is an example code:
#r "System.Drawing"
using System;
using ImageResizer;
using System.Drawing;
using System.Drawing.Imaging;
public static void Run(Stream inputImage, string imageName, Stream resizedImage, TraceWriter log)
{
log.Info($"C# Blob trigger function Processed blob\n Name:{imageName} \n Size: {inputImage.Length} Bytes");
var settings = new ImageResizer.ResizeSettings
{
MaxWidth = 400,
Format = "png"
};
ImageResizer.ImageBuilder.Current.Build(inputImage, resizedImage, settings);
}
source
share