0
votes

I made an Azure Function on a Consumption Plan with a blob trigger. Then I add lots of files to the blob and I expect the Azure Function to be invoked every time a file is added to the trigger.

And because I use Azure Function and Consumption Plan, I would expect that there is no scalability problem, right? WRONG.

I can easily add files to the blob faster than the Azure Function can process them. Hundred users can add to the blob but there seems to be only one instance of the Azure Function working at any one time. Meaning it can easily fall behind.

I thought the platform would just create more instances of the Azure Function as needed. Well, it seems it doesn't.

Any advice how I can configure my Azure Function to be truly scalable with a blob trigger?

1

1 Answers

2
votes

This is because you are affecting with 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.

When to consider Event Grid?

Use Event Grid instead of the Blob storage trigger for the following scenarios:

  • Blob storage accounts
  • High scale
  • Minimizing cold-start delay

Read more here


Update in 2020

Azure Function has a new tier/plan called a premium where you can avoid the Cold Start E.g, YouTube Video