Fluent Installation

A friend of mine Nick Hammond has recently embarked on an interesting open source project to provide a fluent interface to setup a web server.  What is clever about the project is that it makes use of cmdlets meaning that it is easy to use in Powershell. Allowing you to plug into your deployment pipeline.

Far too often Dev, Test and Live environments differ wildly.  They all have their little quirks and nuances.  Comments like “Oh if you use test environment B remember that the site is on drive D not drive C” are far too common.

This project attempts to solve that problem by moving the task of setting up an environment from a manual to an automated repeatable one.

Here is a snippet of some sample code to configure a web site using the fluent API:

    .CreateWebsite(site =>

            site.AddBinding(binding =>

            site.AddApplication(application =>

            site.AddVirtualDirectory(virtualDirectory =>

The syntax is clear and readable. The hallmark of a good syntax/API is one where you know what it is doing just from reading the code.  You don’t need to dive into the implementation.

Under the covers the fluent API makes use of the Microsoft.Web.Administration assembly and in particular the ServerManager class.  In typical Microsoft fashion the ServerManager class wields a lot of power but out of the box it is hard to use and test (please start using interfaces Microsoft!!).  With Nick’s fluent installation project all of that changes!

I have already started to get involved in this project as I think it could grow into a very useful tool for automating the deployment/setup of websites. Why not check out the source code on github and get involved.