I am new to Azure and tried my hands on azure blob storage trigger function.
I have created a function:
public static void Run(Stream myBlob, string name, Stream outputBlob, ILogger log)
{ log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
}
function.json file:
{
"bindings": [
{
"name": "myBlob",
"type": "blobTrigger",
"direction": "in",
"path": "hunaincontainer/{blobname}.{blobextension}.",
"connection": "hunainfunctionstorage1_STORAGE"
},
{
"type": "blob",
"name": "outputBlob",
"path": "hunaincontainer/{blobname}-ResizedImage.{blobextension}",
"connection": "hunainfunctionstorage1_STORAGE",
"direction": "out"
}
],
"disabled": false
}
hunaincontainer is a blob storage container in general purpose storage account. I am using free Azure for testing.
I run the function and it compiles successfully and then I upload an image to hunaincontainer using portal but it doesn't hit the function. Why? The connectionstring, key value and everything is set.