VS Azure Function Blob Trigger does not fire

Karn Dalmia 0 Reputation points Microsoft Employee
2025-02-07T02:27:36.99+00:00

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"

}

}

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,396 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,063 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,405 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.