I am using Azure Functions v2.0-beta and writing timer-triggered functions in Node.js.
When I make any change to my JavaScript file, the first run of a function takes approximately 2-4 minutes instead of the usual milliseconds.
During that time, the functions consumes a large number of execution units and also the storage usage spikes a lot, with tens of thousands of read or write requests.
Here's an example of a relatively fast startup which took 2 minutes:
2018-08-17T19:22:03.001 [Information] Executing 'Functions./my function name/' (Reason='Timer fired at 2018-08-17T19:22:03.0013209+00:00', Id=3ff72e1c-8dd9-4fd9-925c-8057aac25229)
2018-08-17T19:24:06.510 [Information] Executed 'Functions./my function name/' (Succeeded, Id=3ff72e1c-8dd9-4fd9-925c-8057aac25229)
The function is running in the East Asia region.
Expect the function to start up within a few seconds and do not consume thousands of write operations on the storage.
As an example:
Hi @catcher-in-the-try, sorry about the delayed response on this. We have made a lot of changes leading to our recent GA - is this still an issue?
For functions with lots of dependencies, our recommendation is to use Run From Package with Zip Deployment (docs here: https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push#run-functions-from-the-deployment-package)
I found my way here after noticing my rather basic Node.js Azure Functions app was taking a few minutes to respond to the infrequent requests it receives and its storage account was reporting a large amount of write operations correlated with the requests. It looks like "Run From Package with Zip Deployment" is going to be very helpful. 馃榿
馃憤 ! We're working to make this the default deployment method everywhere too!
Most helpful comment
For functions with lots of dependencies, our recommendation is to use Run From Package with Zip Deployment (docs here: https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push#run-functions-from-the-deployment-package)