How to speed up slow Azure App Service Zip Deployment?
Asked Answered
T

1

5

I am deploying a Nuxt application with Appveyor over Azure App Service Zip Deploy, but I am having trouble with the full deployment process being incredibly slow (Around 30+ minutes).

It seems that the whole build process is going as it should, but zipping the files takes around a minute or two (106 MB), and the file is successfully being pushed to the app service within a reasonable amount of time. However the incredible waiting time is at the Site Under Construction white page stage, taking down the whole website with it.

  1. Does anyone have any tips to speed up this process besides upgrading the App Service plan?
  2. Is there any way to avoid the blank Site Under Construction page? For example, is there a way to unzip to another folder and move the files after everything is done so I would get minimal downtime on the website?
Tatouay answered 14/9, 2021 at 12:40 Comment(1)
Hi Marius Mikelsen , Could you please refer this links for speed up and configure your continuous deployments ppolyzos.com/2017/01/15/… ,& MS DOC.Horotelic
C
10

You can add WEBSITE_RUN_FROM_PACKAGE=1 app settings This option will deploy your app service to read only file system (read-only wwwroot folder, other folders are available for write operations) Please take into account if you set this variable on ci/cd tool side probably the first time it won't apply because app settings are passed after zip deployment

And regarding the second questions. I guess it could be fixed by another app settings SCM_CREATE_APP_OFFLINE=0 (it should update your app without bringing it offline)

Christiechristin answered 16/10, 2021 at 11:44 Comment(3)
Thanks Sasha for the tip! It went from 18 min to 23 s after adding this in the slot app settings, kudos!Dedicate
Suppose if my app (SSR) used to write cache/logs to a folder (.next) under wwwroot will this work ?Fructidor
@Fructidor using WEBSITE_RUN_FROM_PACKAGE=1 will break Next filesystem caching. Leaving this comment for everyone who is facing this issue. Since the zip deployment will be read-only, Next.js cannot create it's cache folder.Czerny

© 2022 - 2024 — McMap. All rights reserved.