0

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 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

3 Comments

I will definitely look into Event Grid. Will just mention in case anyone comes here, that it is not because of cold start. Even if the function is running, it cannot keep up with the speed of the files uploaded and will get further and further behind.
We are using the Event Grid and still run into troubles. Triggering as event grid locally, it works but when trying on the portal it fails to do so.
what is the usefulness of blob triggers then?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.