I'm having a tough time with cold start issues on my Azure Function App. My app is implemented in Python with four web triggers and two timer triggers. It's meant to take in survey data from ESRI's Survey123 and queue the results for processing. I've set up a timer trigger that checks the queue every 20 seconds. However, if the app sits idle for about 10 minutes, the first survey submission seems to get ignored, while subsequent submissions work without a hitch. I've even added another timer that triggers the web function every two minutes, but that hasn't fixed the issue either. This is just a dev environment; my production setup is fine. I'm open to ideas for a solution to this cold start problem!
5 Answers
I've encountered a similar situation where the first invocation from a service bus trigger didn’t generate logs in the stream. It appears the function runs but just doesn’t log on the first call. The logs end up in the storage account though, so you can still track invocations there.
You might want to consider running your function in a container on a container platform. That could help with the cold start issues you're facing too.
You could set up a timer trigger that pings your database to keep it alive. Alternatively, using a service like Cloudflare for health checks on your HTTP endpoints could also help.
One way we solved a similar issue was by using the flex consumption plan but setting it to have one always ready instance. This helped mitigate the cold start delays significantly!
Have you considered using service bus triggers instead of timers? It might help streamline the design and reduce cold start issues.

That seems to have done the trick. Thanks much!