An Azure service that provides an event-driven serverless compute platform.
Azure Function Flex Consumption routes HTTP requests to new cold instances while an always-ready instance is idle
Our Function App on the Flex Consumption plan has one always-ready instance for the http group, and HTTP concurrency stays far below the per-instance limit. Flex still keeps starting new on-demand instances and sends user requests to them. Each such first request pays a cold start of 2–11 s. In 16 of 27 cases since we enabled always-ready, another HTTP-serving instance was alive and idle, with no request in flight anywhere in the app, when Flex started a new instance and routed the request there.
We would like to understand why this happens, and how to configure the app so that requests go to the warm instance instead of new cold ones.