1

Where I work, we release bug fixes in to the system every night when we know our clients are not using the system.

Trying to take a step towards better service I'd like to deploy to IIS while the application is running.

A solution that comes to mind is to setup two different IIS applications and switch them over after deploy using a script. But I'm not going to try this out as I don't want any complications during our busy hours.

Does anyone have experience in this area of deployment?

Thanks

Razor
  • 17,271
  • 25
  • 91
  • 138

1 Answers1

3

Regardless of whether you're using PHP, ASP, ASP.NET etc there is no native support for transactional deployment on IIS.

The simplest approach would be to have two physical folders and (optionally two web sites - one production, one test) on your web server, for example:

c:\websites\myapp\dep1  
c:\websites\myapp\dep2

Initially your site would have its physical path pointing to c:\websites\myapp\dep1.

When you deploy your latest build you'd deploy into c:\websites\myapp\dep2. Once you're done just switch the physical path of the production site over to this folder. This means you still have the original site and can fall back to it if the new code fails for whatever reason.

The next time you do a deployment you'd deploy into c:\websites\myapp\dep1 and once you're done switch the production site to that folder.

You could optionally have a test site that points to the folder you're deploying to so you can make sure the site works before switching your production site over.

This could all be scripted.

Here's some related reading that may be of interest:

Publishing/uploading new DLL to IIS: website goes down whilst uploading

Is smooth deployment possible with componentized ASP.NET MVC apps?

Rob Conery also had an excellent blog post about the lack of a decent deployment story for ASP.NET application. You should take a trawl through the comments some of which are quite insightful:

ASP.NET Deployment Needs To Be Fixed

Getting Constructive On ASP.NET Deployment

Community
  • 1
  • 1
Kev
  • 118,037
  • 53
  • 300
  • 385
  • 1
    This strategy, scripted in Powershell and using ARR: https://github.com/yosoyadri/IIS-ARR-Zero-Downtime/blob/master/DeployLocalFarm.ps1 – Yosoyadri Mar 04 '13 at 11:13
  • @Adrian nice one. Might be worth noting that the `Get-NetIPAddress` and `New-NetIPAddress` cmd-lets are only available out of the box on Windows 8/2012. – Kev Mar 04 '13 at 11:56
  • Thanks @Kev, I wasn't aware of that. I gave up before putting together the script to create the farm, nodes, ips and all the setup required. Although all the functions are there - in case someone wants to venture and do it - the Deploy function in the script is not relying on any of them and can be run on earlier versions of Windows, instead it assumes that what's required have been setup previously, manually or by script. – Yosoyadri Mar 04 '13 at 18:23