2

I've seen in multiple Azure function apps that the host is stopping on a regular basis and automatically restarting. Since a week on of my Azure function apps is stopping, but I need to manually restart the host.

In ApplicationInsights a ran the following query:

traces 
| where message == "Job host stopped" or message == "Job host started"
| order by timestamp asc

snippet from traces

  • 23-1-2022 20:08:42.436 Job host started
  • 23-1-2022 20:09:25.668 Job host stopped
  • 23-1-2022 21:08:48.800 Job host started
  • 23-1-2022 21:11:33.702 Job host stopped
  • 23-1-2022 22:17:03.286 Job host stopped
  • 23-1-2022 22:18:39.002 Job host started
  • 23-1-2022 23:10:31.580 Job host stopped
  • 24-1-2022 06:41:48.024 Job host started
  • 24-1-2022 06:42:44.680 Job host stopped
  • 24-1-2022 06:43:00.902 Job host started
  • 24-1-2022 07:10:52.220 Job host stopped

The start on 24-1-2022 06:41 is due to a manual restart of my function app. No timetrigger has executed durring this stop period. This is happening more than once a day. Without a pattern.

Any ideas? eventlog isn't usefull, between the auto-stop and manual restart is nog logging in insights.

How can I trouble shoot this? Why is the function restarting so often?

Update: a manual trigger (http) is restarting the host.

1 Answers1

0

Good morning Johan.

If your host is permanently stopped:

try checking app_offline.html file within your project.

for more detailed info: https://www.codit.eu/blog/why-is-my-azure-function-host-permanently-stopped/

If your question is related to that the host start and stop continuosly:

This kind of behaviour can be related to your plan, I think you have a consumption plan within you azure functions.

Consumption plan: On the Consumption plan, instances of the Functions host are dynamically added and removed based on the number of incoming events.

Premium plan: Your function apps run continuously, or nearly continuously.

Dedicated plan: Run your functions within an App Service plan at regular App Service plan rates.

For more info you can go to https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale

  • Host is not permanently stopped, calling a manual HTTP-trigger is starting up the timetriggers again. I have a consumption plan, but non of our function apps (we have a about 40 apps running) is having this behavior. – Johan van Dijke Jan 27 '22 at 09:41