3

In WebsiteAzure we have an Staging feature. So we can deploy to one staging site, test it, fill all caches and then switch production with stage.

Now how could I do this on a normal Windowsserver with IIS ?

Possible Solution One stragey i was thinking about is having a script which copies content from one folder to an other. But there can be file locks. Also as this is not transactional there is some time a kind of invalid state in the websites.

First Poblem: I've an external loadbalancer but it is externally hosted and unfortunately currently not able to handle this scenario.

Second problem As I want my scripts to always deploy to the staging i want to have a fix name in IIS for the staging site which i'm using in the buildserver scripts. So I would also have to rename the sites.

Third Problem The Sites are synced between multiple servers for loadbalancing. Now when i would rebuild bindings on a site ( to have consistent staging server) i could get some timing issues because not all Servers are set to the same folder.

Are there any extensions / best practices on how to do that?

2 Answers 2

2

You have multiple servers so you are running a distributed system. It is impossible by principle to have an atomic release of the latest code version. Even if you made the load-balancer atomically direct traffic to new sites some old requests are still in flight. You need to be able to run both code versions at the same time for a small amount of time. This capability is a requirement for your application. It is also handy to be able to roll back bad versions.

Given that requirement you can implement it like this:

  1. Create a staging site in IIS.
  2. Warm it up.
  3. Swap bindings and site names on all servers. This does not need to be atomic because as I explained it is impossible to have this be atomic.
Sign up to request clarification or add additional context in comments.

1 Comment

Could you explain more detailled how to "swap" bindings ? Only thing i know would be to remove one after the other and tghen set one ofter the other which could endup in invalid bindings while users are using the site. Also adding and removing bindings could trigger an appool recycle doesn't it ?
1

as explained via Skype, you might like to have a look at "reverse proxy iis". The following article looks actually very promising

http://weblogs.asp.net/owscott/creating-a-reverse-proxy-with-url-rewrite-for-iis

This way you might set up a public facing "frontend" website which can be easily switched between two (or more) private/protected sites - even they might reside on the same machine. Furthermore, this would also allow you to actually have two public facing URLs that are simply swapped depending on your requirements and deployment.

Just an idea... i haven't tested it in this scenario but I'm running a reverse proxy on Apache publicly and serving a private IIS website through VPN as content.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.