Configuring Web Site Binding with Release Management

Release Management provides a continuous deployment solution that makes release cycles repeatable, visible, and more efficient by automating deployments through every environment from test to production.

Within Release Management you have al large set of default Actions and Components to configure a release cycle. On MSDN you can find a list with some common actions that are available within Release Management:

In this list you will find a action for creating a web site “Create Web Site”  and configure a web site “Configure Web Site”. By using the create web site action you will create a web site with default bindings and you would expect to be able to change the bindings by using the “Configure Web Site” action but this is not the case. If you would like to configure the binding on the web site you will have to create a custom action.

You can create a custom action by navigating to the “Inventory” tab and in the action window selecting new.

image

Selecting new will open up a new window in which you are able to configure a new action. In this new action we will start PowerShell and make use of the “WebAdministration” module to add a new binding.

image

As you can see in the image above everything in the “General Information” section speaks for it self. In the example we choose to add the action to the already existing category “IIS” because it is a “IIS” action.

In the “Execution” section specify what the action should execute. In the “Command” field specify the command for execution. For PowerShell specify “powershell” and in the “Arguments” field specify the argument for the command:

-Command "& { Import-Module WebAdministration; New-WebBinding -Name '__SiteName__' -IPAddress '__IPAddress__' -Port '__Port__' -HostHeader '__HostHeader__' -Protocol '__Protocol__'}" 

As you can see in the code we Import the “WebAdministration” module and use the “New-WebBinding” function for adding a new binding with the following parameters:

Parameter Value
Name __SiteName__
Protocol __Protocol__
IPAdress __IPAdress__
Port __Port__
Hostheader __HostHeader__

By using the format __[Name]__ (before and after 2 underscores) Release Management knows that these values can be used as parameters in order to make the action reusable.

When you save this action it will become available to add in your release template.

image

You can drag and drop the action within your release flow and configure it by double clicking the action.

image

When you add a new Binding you will probably also want to be able to remove a binding. You can do this by creating a new action and adding the following argument.

-Command "& { Import-Module WebAdministration; Remove-WebBinding -Name '__SiteName__' -IPAddress '__IPAddress__' -Port '__Port__' -HostHeader '__HostHeader__'}"

Note:When using the create web site action it will create a web site with the default binding. If you add a new binding to the web site you will also have to remove the default binding or else it could be in conflict with other web sites.

Related Posts

Development Cycles (DevOps) and Office365 Just before the Christmas Holiday’s I wanted to share some insights with the readers of my blog around Development Cycles and Office365. Development C...
Release Management in Visual Studio Team Services Visual Studio Team Services is the formally know Visual Studio Online. The old name brought a lot of confusion I think the new name will do a lot bett...
Creating the Release Template that runs after the Build – Part 3 With the component created in part 2 we can start using it to deploy applications to our SharePoint environment. We start by creating a new template. ...
Create a custom component to deploy SharePoint Solutions – Part 2 In the first part of the series we have adjusted a build template in order to copy content from source control to the drop location after the build. T...
Adjust the ReleaseTfvcTemplate.12.xaml build template to work with the BizTalk D... If you want to use the BizTalk Deployment framework in combination with Release Management you need to adjust the default build template that comes wi...
Customize the Release Management Build template – Part 1 To setup a build in combination with Release Management you need the Release Management build template. This template looks like the default build tem...

3 comments

  • Priyantha Perera

    OK this is cool. But what if you have several hostnames and bindings? do you have to create New powershell scripts to handle the variables?

    • No, you are able to use the same block multiple times, the blocks are al parameterized.

      • Priyantha perera

        Maik

        thank you for the reply. I appreciate it..

        If I have a SSL binding, how do I parameterize the PS New-WebBinding to attach to a specific certificate when setting https bindings or is that a complete different step?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.