Description
Is your question related to a specific version? If so, please specify:
What binding does your question apply to, if any? (e.g. Blob Trigger, Event Hub Binding, etc)
HTTPTrigger
Question
We are using Azure Functions with Python (with custom Docker Image) using the Premium Plan to build rest api. It is important for these to reply fast. Hence we would like to ensure that connections stay alive/ tokens are refreshed even though no work is arriving and that they are ready before they receive requests.
My question is therefore two-fold:
-
What is the recommend way to ensure that connections stay alive/ tokens stay fresh? Is that using the health check or using a Timer Trigger? I can see that health checks a some point weren't recommended for premium Are health checks for azure premium functions still not recommended? Azure-Functions#2273 . On the other hand - are Time triggers guaranteed to happen per process running the function such that they will renew the token at hand? .
-
When the function receives the first call it needs to authenticate with a Service Principal to get a token which is used for connecting to other Azure Resources. This can take a some seconds. Is it possible to limit traffic so a newly started function doesn't get incoming requests routed to it before it is ready (similar to readiness probe in Kubernetes). Ì can´t determine if
post_function_load_app_level
fromazure.functions.AppExtensionBase
can be used as it is not clear if requests are still routed (and just wait forpost_function_load_app_level
to complete) or they will go to other instances of the function.