Azure Functions - Always On and HTTP Triggers

Viewed 959

I am currently looking into occasional slow responses after periods of inactivity for an Azure Function application. The Azure Function runs on a dedicated plan, with host runtime version 1.x, and always on enabled. The application uses queue messages to trigger the functions.

I noticed the documentation states If you run on an App Service plan, you should enable the Always on setting so that your function app runs correctly. On an App Service plan, the functions runtime goes idle after a few minutes of inactivity, so only HTTP triggers will "wake up" your functions.

I know that always on sends requests from the front-end load balancer to the application root url, however does that mean I have a http triggered function listening at the root url to ensure the function is always on. I tried this in my local development environment with a function which just returns an OK result and it seems to work. But is it necessary?

I would have thought not, as it was based on the web jobs host which just required the application pool to be not idle.

Any clarification would be extremely helpful.

1 Answers

It would appear that the always on functionality is implemented through the use of a rewrite in the web.config of the function host. A call to the application root url will be forwarded to /admin/host/ping which is part of the host controller.

So in answer to your question

..does that mean I have a http triggered function listening at the root url to ensure the function is always on.

The answer is no.

Related