Azure Function: I'm trying to create a azure function that gets trigger when a folder is uploaded to azure storage account(blob) but it gets triggered for everyfile within the folder.

Ishika Rajput 1 Reputation point
2022-09-21T11:02:10.333+00:00

I'm quite new to azure and I want to create a function that gets trigger and perform certain tasks when an entire folder containing n number of files is uploaded to a blob storage but with my current implementation it gets triggered for every file within the folder. Can someone please tell me what should be done here.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,407 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,500 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Pierre-Luc Giguere 1,076 Reputation points
    2022-09-21T12:23:09.733+00:00

    Hi Ishika,

    Welcome to the Q&A community.

    Without looking at your code nor knowing what language it is a little bit hard for me to give you direct advices. But Microsoft as such an extensive documentation that I can direct you to this article right here:

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=in-process%2Cextensionv5&pivots=programming-language-csharp

    It explains in great details how to do what you are looking for.

    Hope it helps, if it does, please accept this answer.


  2. Atul Moghe 1 Reputation point
    2022-09-23T06:11:12.8+00:00

    If I understand the issue correctly, in your blob storage 'Hierarchical Namespace' is not enabled. In this case the folders are virtual. So basically, all files are stored in root, it's only has prefix as path. Hence your function is triggering for every file.

    Regarding the functionality where you want to trigger the function when the batch input is complete, if the input functionality is in your purview, then you might just want to send a message to Queue/Service Bus, saying the batch input is complete and you can trigger your function from the Queue.

    0 comments No comments