Slow initial run of Azure functions

Occasional Contributor

We see very slow initial run of Azure functions, is there any way to improve this? For example, an event hub triggered function where no events have been sent for a number of hours. When the next event comes through the startup time of the function can be minutes

2 Replies
The Azure Functions service has a scale controller component that monitors your event sources. When an event source goes idle for many hours, it will wait longer to poll your event source for new messages. Looks like this is happening here. There's not much you can do to control this behavior in the consumption plan. One possibility is to switch to the premium plan, but that might not be economical for an app that is not always in use.
Thanks for the explanation Anthony. The premium plan as you have said would not be cost effective for us but I believe if the service was processing events regularly it may not be much of an issue, which i think we can cope with.