Can we prioritise one function over another in an Azure Function App

krishna572 876 Reputation points
2022-07-14T07:14:28.44+00:00

Having the Azure function (.NET Core 6) with service bus queues (2 queues) where there is a trigger function code for each queue.

Seen a issue in the GitHub which shown me that functions will be processed in Alphabetical order.

Instead of processing alphabetical order, I like to do custom order like

  1. Specified function trigger should be processed as first even both triggers are waiting for messages

Is that possible to prioritize explicitly like above scenario?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
548 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,297 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,274 questions
0 comments No comments
{count} votes

Accepted answer
  1. MughundhanRaveendran-MSFT 12,421 Reputation points
    2022-07-18T04:50:18.58+00:00

    Hi @NFSCoder-9821 ,

    Thanks for posting this question in Q&A forum.

    The scenario that you want to achieve is called competing consumers and there is a dedicated design pattern called competing consumers pattern. However there is a limitation with the messaging order with this pattern. The order in which consumer service instances receive messages isn't guaranteed, and doesn't necessarily reflect the order in which the messages were created.
    So it is not possible to prioritize one function over another listening to the service bus queue unfortunately.

    With Durable functions, you can control the orchestrator and activity function but not the starter function, your scenario involves starter function so durable functions wont help in this case.

    I hope this helps! Feel free to reach out to me if you have any further queries or concerns.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Jaliya Udagedara 2,731 Reputation points MVP
    2022-07-15T17:48:58+00:00

    As far as I know, unfortunately, it's not possible at the moment.

    1 person found this answer helpful.
    0 comments No comments

  2. Bruce (SqlWork.com) 56,686 Reputation points
    2022-07-15T19:46:32.037+00:00
    1 person found this answer helpful.
    0 comments No comments