I am designing a solution that includes an Azure Function App function that will be triggered when a blob is created in an Azure Blob Storage container. The Function App will automatically scale out when needed (more than one instance will be available, pre-warmed). If there are two or more nodes active at a specific moment, and a new blob is created, will the function be triggered:
a. For each of the nodes
or
b. For only one of the available free instances (and just one)
2
Answers
This article and this one explain how Azure uses an internal queueing for events and process each of them using an instance if available, or creating a new one if needed. So answer is, Function is triggered only once per triggering event.
Since Azure will not process the same file using multiple instances, for that kind of requirement the fan in fan out pattern must be used.
Only one function instance will process the blob if that is what you really want to know
Well, see the docs:
If you are using the Event Grid to handle blob events things are different as the Event Grid service is responsible for sending events to a Event Grid triggered Azure Function. The function will always react to each event grid event once, but do mind that the Event Grid is designed using a at-least-once delivery mechanism:
(source)