Seth
Seth

Reputation: 2796

Using azure app service with webpack+nodejs without long deployment outages

I'm trying to use webpack with my (fairly large) NodeJS app, deploying as a Windows Azure App Service using Git continuous deployment.

I customized my kudu deploy.sh script to run webpack, but it takes several minutes to webpack on Azure App Service, and the app is unavailable during that time. On my dev laptop, running webpack only takes about 30s (which I could accept as a deployment outage time), but I'm guessing the laptop using an SSD is making this run much faster?

If I was using a deploy script, I'd just run the webpack on my dev machine and push the results to the server, but I'm using git for continuous deployment, and I don't want to commit constantly-changing webpack-generated code to the Git repo.

Is there any way to run webpack-on-deploy with Azure App Service-base NodeJS apps without such a large outage time while deploying?

Upvotes: 1

Views: 916

Answers (1)

Aaron Chen
Aaron Chen

Reputation: 9950

Instead of reducing deployment outage time try leveraging deployment slot to prevent the app unavailable during that time.

Per Azure's documentation,

Deploying a web app to a slot first and swapping it into production ensures that all instances of the slot are warmed up before being swapped into production. This eliminates downtime when you deploy your web app. The traffic redirection is seamless, and no requests are dropped as a result of swap operations. This entire workflow can be automated by configuring Auto Swap when pre-swap validation is not needed.

How to add a deployment slot to a web app, please refer https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-staged-publishing for details.

Upvotes: 2

Related Questions