Building scalable web applications to a Windows IIS farm? Here is the solution to replicating the IIS metabase, SSL certs, Bindings, and code.


Web Deploy 3.5, the answer to scalability with web farms.

Similar to the use of Chef or Puppet, you can use Web Deploy 3.5 to push web server configuration and content to all you web servers in your farm. Previously i used IISCnfg to handle this back in the IIS6 days, but haven’t needed to do this on a windows web server for a bit. Fast forward to Windows server 2012, and you can use Web Deploy 3.5 to replicate the content the configuration etc to servers behind a load balancer.

Step 1: Install the web deploy code on both web servers

Step 2: Setup an account for use to replicate the settings

Step 3: assign permissions on IIS to allow the changes to be deployed

Step 4: create a scheduled task with the script to keep it in sync (I added -whatif to the code so it wont do anything unless you remove that part)


Here is the code i used:

msdeploy -verb:sync -source:webserver,computername=<FQDN of the source servername>,username=<domain\username>,password=<password>,authtype=ntlm -dest:auto,computername=<FQDN of the destination servername>  -whatif >c:\msdeploy.log

Obviously you will need to install the proper roles on the other web servers, and you can review the msdeploy.log to see which dependencies or roles need to be installed.

Here are some more examples from Microsoft on using msdeploy