azureazure-functions

azure function runs triggers in parallel?


I'm creating an application that will use Azure Functions combined with Azure Bus Service. The idea is to process the messages from the bus in Azure Functions. I'm reading the documentation and I want to confirm one thing: In the Consumption plan, do the instances automatically grow based on the triggers, with a limit of 100 instances? That is, if at any given time 50 messages arrive in my queue, will 50 functions be activated at the same time in parallel? Thanks


Solution

  • You are right in your understanding, however there are these considerations you should be aware of:

    {
      "version": "2.0",
      "extensions": {
        "serviceBus": {
          "prefetchCount": 100,
          "messageHandlerOptions": {
            "maxConcurrentCalls": 32,
            "maxAutoRenewDuration": "00:05:00"
          }
        }
      }
    }
    

    prefetchCount: Determines how many messages the Functions runtime will retrieve in advance

    maxConcurrentCalls: Sets the maximum number of messages that can be processed concurrently on a single instance.

    maxAutoRenewDuration: Sets the maximum duration within which the message lock will be renewed automatically.