14

I have a customized deploy.cmd file that I use for deploying my Azure website. It does a few custom things like installing nodejs versions of Typescript and a minifier, and then running unit tests, before building and deploying the website itself.

The problem I'm running into is that it seems to be taking an increasingly long time to run this script, at least out on Azure. On my dev laptop, it takes about 90 seconds to run the deploy.cmd script. But when I'm pushing it out on Azure, it takes something more like 15-20 minutes to run (and sometimes upwards of 30-40 minutes). I'm not surprised that it's taking longer out on a web server - I am a little surprised that it's taking more than 10 times longer.

Here's a stripped down version of the log file for a recent deployment:

Command: deploy.cmd
18:54:16.89 - Starting deploy script
18:54:19.92 - Installing typescript
18:54:30.90 - Installing minifier
18:54:44.62 - Restoring Nuget Packages
18:55:48.25 - Building solution
18:59:09.12 - Building test projects
19:04:03.67 - Running Payboard.Common.Tests.dll
19:04:19.80 - Running Payboard.Model.Tests.dll
19:04:25.25 - Running Payboard.Services.Tests.dll
19:06:29.72 - Running Payboard.Integrations.Tests.dll
19:06:49.46 - Running Payboard.Web.Tests.dll
19:07:56.99 - Beginning KuduSync
19:08:03.16 - Finished successfully.

Obviously it's the two build steps that are taking the majority of the time. I suppose I could merge those into one single build step - though I'm not completely certain how that would work with KuduSync.

Any other suggestions on how to speed this up? Or is this basically just expected?

Ken Smith
  • 20,305
  • 15
  • 100
  • 147
  • 1
    Is this a website running on Free, Basic or Standard tier? What is the instance size? There may be a processing bottleneck. More details here: http://azure.microsoft.com/en-us/pricing/details/websites/ – Maria Ines Parnisari Jan 08 '15 at 05:03
  • 1
    It's Standard with a single core. I'll try bumping it up to a double core. – Ken Smith Jan 08 '15 at 05:08
  • 2
    Just following up. Bumping the size of the "Standard" instance up to a double core didn't seem to help. My last deployment took 30 full minutes. – Ken Smith Jan 12 '15 at 19:09
  • 1
    Hm. Do you have more details on the "build solution" step being performed? – Maria Ines Parnisari Jan 12 '15 at 23:05
  • 1
    I am facing exact same problem, only it takes 30-60 minutes! FML – Korayem Aug 17 '15 at 14:11
  • I think it is because it needs to boot up and reset the VM underneath. You can use MS deploy to deploy the Azure Website from CI and it's a lot faster. – Michael Sync Sep 15 '15 at 05:25

2 Answers2

0

I suspect that with mention of nodejs, there are a bunch of npm packages being downloaded as part of the build. On your local machine, these are already present but Kudu is restoring them in a clean folder every time.

Secondly, about 5 mins of your build time is spent on building (and probably running) test projects. Unless intentional and required in deployment workflow, I would recommend turning if off via a flag.

Abhay Saraf
  • 1,202
  • 9
  • 19
0

Are you doing a build or a rebuild ? Build will build only if needed; rebuild will build everything regardless.

Also, you might be deploying release version vs compiling and deploying the debug version locally and it might be the release compile optimizations that are taking longer. (If that is the case, try doing a release build on local and see if times match)

Look at your publish profile if you are doing something such as "clean solution" at start.