1

I've created a function with runtime v2. The function gets stuck periodically due to out of data in the service bus topic. The function remains down and doesn't work. One way to restore the function back to work is to enter the portal, and look at the streaming log. It will cold start the function, and start working again.

Am I doing something wrong, or is it a bug in azure function runtime v2?

Dor Zion
  • 11
  • 2
  • Did you mean your function project works fine in azure portal and get error in local machine? – Janley Zhang Apr 17 '18 at 09:30
  • No. It works fine both in azure portal and local machine. But in Azure portal the function stops working after a while (when there is not data available in the service bus topic). – Dor Zion Apr 17 '18 at 10:20
  • 1
    Out of curiosity is this deployed on the consumption plan or is it on a standard app service ? – snowCrabs Apr 17 '18 at 22:24
  • Is your issue that adding new service bus topics does not trigger your function if it hasn't been running for a while? Or that the host will stop running once you are out of service bus topics? And +1 to the consumption plan vs. standard app service plan question! – Marie Hoeger Apr 17 '18 at 22:50
  • I've tested it, and I think it is triggered only when I enter the function in azure portal. So, the service bus topic doesn't trigger the function **or** no hosts are running at all, and when I enter the debug section, azure creates instances for the function. @snowCrabs I'm using the consumption plan, as usual. – Dor Zion Apr 19 '18 at 07:29
  • I vaguely remember there being a known bug with ServiceBus triggers and consumption based functions.. I'll see if I can find the documentation – snowCrabs Apr 19 '18 at 16:53

2 Answers2

0

I believe you may need to enable Always On.

Refer to this thread: How do I turn on "always-on" for an Azure Function?

Piroinno
  • 115
  • 1
  • 9
  • Is it necessary? We have more functions that are working fine in consumption mode. The only difference between the existing functions and my function is the runtime version. – Dor Zion Apr 19 '18 at 07:32
0

Have you tried turning it off and on again? All joking aside, hitting the "refresh" button next to the function app in the portal may sync your trigger with a central listener and resolve this error. There is an outstanding bug with Consumption Plan functions where triggers sometimes get out of sync and don't fire unless the portal is open if they are published in certain ways (details here: https://github.com/Azure/Azure-Functions/issues/210).

To avoid this issue in the future, you can make sure that you're deploying using the following options (see issue for details):

Marie Hoeger
  • 1,261
  • 9
  • 11
  • I've tried to restart to function and hit the refresh button. Unfortunately, nothing helped. Also, I deploy the function with Azure Functions CLI. – Dor Zion Apr 22 '18 at 08:49
  • Can you share your function app name so that we can investigate internal logs? If you don't feel comfortable sharing it publicly, you can also follow these steps: https://github.com/Azure/azure-functions-host/wiki/Sharing-Your-Function-App-name-privately – Marie Hoeger Apr 23 '18 at 18:34