Azure Function Service Bus Trigger

Alessandro Pirovano 1 Reputation point

I have an Azure Function, with consumption plan, triggered by a Service Bus message, I need that the functions process one or two messages at time.
I limited the instances to one:

And in the host.json of the function I used maxConcurrentCalls at 1.


However, the function keeps firing multiple times for different messages.
What can I do to limit the executions?


Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
571 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,499 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Urnun 9,776 Reputation points Microsoft Employee

    Hello @Alessandro Pirovano - Thanks again for reaching out & posting on the MS Q&A channel!

    You do have the correct & minimal configuration for achieving the "one message at a time" processing. The reason why it may not be working as intended is probably that you have Version 5.x of the Service Bus Extension installed but yet in the host.json file, you seem to be using the messageHandlerOptions wrapping the maxConcurrentCalls setting, which is an implementation for previous versions of the Service Bus extension.

    If you, indeed, have the v5 of the Service Bus extension, you could omit the messageHandlerOptions wrapper as follows:

       "version": "2.0",  
      "extensions": {  
        "serviceBus": {  
          "serviceBus": {  
            "maxConcurrentCalls": 1  

    Alternatively, if you want to use the previous version of the Service Bus extension, you'll want to install the right version. For example, here's the NuGet package of the extension for version 4.3.0 (which will support your current setting in the host.json file):

    For a full reference on the exact differences between in host.json file based on your target Service Bus extension version, please review our official doc:

    I hope this helps resolve the issue but if you continue to hit the same issue, let me know and we can dig deeper.

    0 comments No comments