Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Azure Function Service Bus trigger goes idle when no messages are present in the Topic (Consumption Plan)

Open Shmirre opened this issue 2 years ago • 12 comments

Hi,

We are encountering a strange issue / strange behaviour in our Azure Service Bus Trigger.

The purpose we are trying to fullfill:

  • Everytime a message is sent to the Service Bus Topic, we would expect that (even after a short delay ..) the trigger picks up the message and the function processes this.

The error / issue that we encounter:

  • It looks like, after the function initially processed all the messages in the Topic, the function goes idle and it doesn't automatically wakes up when new messages are present on the Service Bus Topic.

We checked a lot of possible scenarios & analyzed the behaviour:

  • Going to the UI of the function or the parameters in the portal wakes the function up
  • Scrolling through the appsettings in the portal wakes the function up
  • Redeploying through CI/CD also wakes the function up

Then, after the function processed all the messages in the topic, it goes idle again and it doesn't wake up automatically.

I've already read a lot of issues on this but those trace back to 2017-2018 and all the issues were related to the connectionstring not having 'Manage' access so the scale controller could not fire. We use a connectionstring and the connectionstring has manage rights so this issue should in our case not be present.

Time Range (UTC +2): image

Function Log:

2023-05-31 09:24:50.918

Executed 'LoggingOrchestrator_EventTrigger' (Succeeded, Id=c2ddddbd-51eb-4387-a550-7d4113f881ed, Duration=194ms)

Host.json image image

Kindly let me know if you require more information or logs on this issue and i'll gladly provide those.

Shmirre avatar May 31 '23 09:05 Shmirre

Hi @Shmirre, Thanks for information will update you soon

vijaykumar911 avatar May 31 '23 10:05 vijaykumar911

check that the connection string used in your Azure Function has the necessary permissions to receive messages from the Service Bus Topic and verify function's configuration is set up correctly. check the function.json file that defines the Service Bus Trigger binding. Make that the connection property in the binding is correctly configured to use the appropriate connection string.Verify the values in your host.json file, particularly the extensions section related to the Service Bus extension. Ensure that the maxConcurrentCalls and prefetchCount settings are properly configured.Check the Azure Function scaling setting by Verify the function app scaling settings are appropriately configured.

vijaykumar911 avatar May 31 '23 17:05 vijaykumar911

Hi Vijay,

We have checked all the things you mentioned but none were a solution.

Real Case Scenario from today: image

The images pile up in the service bus topic and for unknown reason, 30 minutes ago, the function woke up again. Could you please advice us more in-depth on how we should tackle this issue so that the function is fired more often since this will leave us with production issues where there are no loggs available for specific runs.

Thanks in advance Kind regards Senne

Shmirre avatar Jun 01 '23 14:06 Shmirre

Hi, Would like to ask if there are any solutions for this matter. It's getting fairly critical to have a solution / workaround for this. Is this issue known @ Microsoft? Or is this something not a lot of people experienced? While browsing and reading the weg, i came across a lot of people having the same issues but i'd like to find the reason why this is occuring.

Thanks in advance kind regards Senne

Shmirre avatar Jun 06 '23 12:06 Shmirre

Hi,

Are there any updates on this issue ? Any workarounds?

Thanks in advance

Shmirre avatar Jun 13 '23 10:06 Shmirre

I am also having the same issue, suddenly started happening 2 days ago and no clue. If I open logs through monitor, the function wakes up otherwise my messages keep piling up in the service bus queue. Any help please?

abdul-smartviz avatar Jan 29 '24 16:01 abdul-smartviz

We've noticed very similar behaviour in one of our function apps after migration to the consumption plan. Previously we've hosted it on the app service plan with Always On option enabled without any flaws.

malcuch avatar Mar 25 '24 17:03 malcuch

After talking to Microsoft Support, it was an issue at their end and I was informed that the service which is responsible to trigger the function was not working for my Function App.

abdul-smartviz avatar Mar 25 '24 17:03 abdul-smartviz

We recently started to see a similar problem in a specific Azure region. After adding an appsetting with the same name and value as the connectionstring-setting, the function app scaling and processing of new messages started working as expected again.

Rufus1123 avatar May 29 '24 12:05 Rufus1123

We had a MS support case for this, their take on it? "Don't use consumption for prod"....

fsmartini avatar Sep 03 '24 08:09 fsmartini

I’m suffering the same

  • consumption plan -managed id (‘owner/reader/sender) user assigned

Only a service bus trigger. It will not wake on new message after it has gone idle.

vincentnl avatar Sep 14 '24 21:09 vincentnl

I am experiencing the same issue. I have azure function in consumption app subscribed to a asb topic. Once the function goes idle, new messages are not consumed.

kyurkchyan avatar Jan 23 '25 04:01 kyurkchyan