Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Function deployment slow

We're finding that a deployment of our Azure Function (AFRv1 / Node.JS) is taking a really long time (15-25 minutes). The cause of this is clearly the number of files in node_modules, but I feel like there must be a better way around this that I haven't looked at.

We deploy the application and node_modules (pre-yarn-installed) as a zip package using the Azure App Service Deploy VSTS task.

Is there an optimised way of deployment using an archive that doesn't take such a long time? Perhaps something that is better at differential deployments?

like image 550
Richard Szalay Avatar asked Aug 21 '18 05:08

Richard Szalay


People also ask

How long does it take to deploy Azure function?

For some reason, 1 function takes between 2 to 20 minutes to deploy. It's always the same function, and all the others take about 30 seconds.

How long can an azure function run for on consumption Plan 1 minute 5 minutes 10 minutes 15 minutes?

Guaranteed for up to 60 minutes.

Can Azure functions be long running?

Long-running functions can be implemented through Azure Durable Functions.


1 Answers

Yes, you can do two things to reduce deployment time (and cold start time too):

  1. Bundle your node modules with WebPack, have a look at Azure Functions Pack tool.

and/or

  1. Use Run from Package deployment.
like image 183
Mikhail Shilkov Avatar answered Sep 30 '22 19:09

Mikhail Shilkov