Blob trigger function is not getting fired automatically when there is a change in blob

Amar Agnihotri 916 Reputation points
2022-08-20T12:14:26.257+00:00

Hi,
I have created a blob trigger function and published it to azure successfully . Here is my adf pipeline which creates a file in blob as a result of copy activity -

233069-image.png
and this is my blob trigger function -

233141-image.png

When a new blob will be created as a result of above adf activity the blob trigger should be fired automatically but it is not getting fired . My pipeline is scheduled for execution via trigger but when i saw my blob the function was not fired then i clicked the function app url -
233010-image.png
and then it opened this page
233112-image.png

then after doing this when i manually executed my pipeline the blob trigger is got fired each time it sensed a blob change . Now for tomorrow it will not get fire again then i have to repeat the same step.

To avoid this for time being i added the web activity in my pipeline to run the function app url after creating a blob so that function will get fire
233044-image.png
233077-image.png

Now can anyone help me in this? Why is it happening ? Which settings are missing by me ? or do i really need to hit that function app url to trigger the function again n again.

Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,496 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. PeterSh 176 Reputation points
    2022-08-22T00:13:36.663+00:00

    I've struggled a lot with storage triggers, and they can be really tough to get to the bottom of (from a support point of view).

    I'd recommend stopping and starting your function as a first point. Depending on how you deploy, the trigger can require this. If it seems to work right away, wait for a day and try again to be sure. Many of my issues worked fine in active testing but started ghosting me after a few hours.

    For testing purposes, I'd take a look at your storage account. I've had issues with storage account versions (I always use v2 storage now because I found it more stable - the storage created when setting up the function is v1 by default). If you can, just stand up a new storage account with the alternate version of what you are using and point your trigger there, just to see if it behaves differently.

    Also, from the storage layer, we needed to switch to Locally Redundant Storage (LRS) as well, but I can't recall if this fixed the issue or was just left from testing. If you're testing the storage layer, then this is another variation to look at.

    As an alternate approach, you could consider using an HTTP trigger on your function, add an Azure Function action to your pipeline and pass in the filename as a parameter. This latter is what I tend to do now, mainly because I've lost trust in storage triggers because of odd issues just like this, but also because I prefer to see triggering actions rather than have transparent activities that can be inadvertently triggered.

    The bottom line, though, is the issue is not likely to be with the trigger itself but more with the event that gets raised on the storage account when the file is created. i.e. a storage event issue rather than a trigger issue.

    Hope this helps.

    2 people found this answer helpful.