4

I am using App service plan for azure function, and have added blob triggers but when any file is uploaded to blob container,Functions are not triggering .or sometime its taking too much time , then after it start triggering. Any suggestion will be appreciated

It should trigger the function as and when new files is uploaded to blob container.

Ibrahim Shah
  • 95
  • 1
  • 7

3 Answers3

4

This should be the case of cold-start

As per the note here

When you're using a blob trigger on a Consumption plan, there can be up to a 10-minute delay in processing new blobs. This delay occurs when a function app has gone idle. After the function app is running, blobs are processed immediately. To avoid this cold-start delay, use an App Service plan with Always On enabled, or use the Event Grid trigger.

For your case, you need to consider Event-Grid trigger instead of a blob trigger, Event trigger has the built-in support for blob-events as well.

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
3

Since you say that you are already running the functions on an App Service plan, it's likely that you don't have the Always On setting enabled. You can do this on the App from the Application Settings -> General Settings tab on the portal:

Enable Always On

Note that Always On is only applicable to Az Functions bound to an App Service plan - it isn't available on the serverless Consumption plan.

Another possible cause is if you don't clear the blobs out of the container after you process it.

From here:

If the blob container being monitored contains more than 10,000 blobs (across all containers), the Functions runtime scans log files to watch for new or changed blobs. This process can result in delays. A function might not get triggered until several minutes or longer after the blob is created.

And when using the Consumption Plan, here's another link warning about the potential of delays.

StuartLC
  • 104,537
  • 17
  • 209
  • 285
0

Blob storage trigger will generate latency since it scans the container with the defined intervals. sometimes it could delay for triggering next blob change due to this latency. this explains their documentation and suggested some strategies to overcome this. blob container event grid trigger might be a good option for a certain cases if you're maintaining consumption based plan in your azure function app.

Azure Blob Triggers sometime taking too much time to get triggered

asaindunil
  • 29
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 31 '23 at 03:36