VS Azure Function Blob Trigger does not fire
When I configured an Azure Function on VS code, it did not fire whenever there was a change in blob storage in my PBIZeroTouchBlob.cs file, which was tested in three different locations - same directory as PBIZeroTouchBlob.cs file, Azure Storage Emulator directory, and Azure Storage directory. I'm also not quite sure where the blob-container is located. Is in on my local machine or storage explorer ?
Attached is my PBIZeroTouchBlob.cs file, host.json file, and local.settings.json file.
PBIZeroTouchBlob.cs:
using System.IO;
using System.Threading.Tasks;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;
namespace PBIZeroTouchBlob
{
public class PBIZeroTouchBlob
{
private readonly ILogger<PBIZeroTouch> _logger;
public PBIZeroTouchBlob(ILogger<PBIZeroTouch> logger)
{
_logger = logger;
}
[Function(nameof(PBIZeroTouch))]
public async Task Run([BlobTrigger("samples-workitems/{name}", Connection = "AzureWebJobsStorage")] Stream stream, string name)
{
using var blobStreamReader = new StreamReader(stream);
var content = await blobStreamReader.ReadToEndAsync();
_logger.LogInformation($"C# Blob trigger function Processed blob\n Name: {name} \n Data: {content}");
}
}
}
host.json
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
},
"enableLiveMetricsFilters": true
}
}
}
local.settings.json:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
}
}