I have an Azure Function isolated process running on Azure and I am trying to understand the host lifetime (not the timeout). The general way of working, read in various blogs and tutorials, is that whenever an azure function receives a request for the first time, on the consumption plan, we face a cold start meaning the host needs to spin up - load the runtime and code in order to serve the request. Depending on your runtime (.Net, javascript etc) this cold start can vary but for .Net usually a few seconds (depending on what it needs to load of course) to serve the request. When we get past this cold start I get responses in the ranges of milliseconds. If the requests keep getting in the host instance is kept alive until requests no longer exists. Then the instance is shut down saving energy and costs which is good. What I do not understand is to keep this instance alive. Many blogs and tutorials mentions a host lifetime of 10 mins and it only requires 1 request to enable that 10 minutes lifetime but from my own tests this is certainly not the case. I have tested with standard and classic availablility test (hitting with 5 minutes intervals) and I see the host is shutdown and then reentering the cold start phase again. I even did a timetriggered azure function with a setting of every 2 minute to request the azure function and the result is the same. Can someone explain why I experience it this way?
Thx