Azure Function Service Bus trigger goes idle when no messages are present in the Topic (Consumption Plan)
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):
Function Log:
2023-05-31 09:24:50.918
Executed 'LoggingOrchestrator_EventTrigger' (Succeeded, Id=c2ddddbd-51eb-4387-a550-7d4113f881ed, Duration=194ms)
Host.json
Kindly let me know if you require more information or logs on this issue and i'll gladly provide those.
Hi @Shmirre, Thanks for information will update you soon
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.
Hi Vijay,
We have checked all the things you mentioned but none were a solution.
Real Case Scenario from today:
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
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
Hi,
Are there any updates on this issue ? Any workarounds?
Thanks in advance
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?
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.
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.
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.
We had a MS support case for this, their take on it? "Don't use consumption for prod"....
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.
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.