Enable web deploy on IIS 8 running on 2012 R2

Enable web deploy on IIS 8 running on 2012 R2

Web deploy enables a developer (or anyone with sufficient privileges) to build and deploy a website using visual studio or via the command line using MSBuild. An example of such a build command can be found in my previous posts.

We use it mainly in our continuous integration environment to automatically build, test and deploy new code if a new commit to the git master branch was detected.

Installation via web platform installer

First you will need administrator rights to install web deploy via the web platform installer.

deploy01

deploy02

deploy03

deploy04

Install and enable the management service

Once that is completed close IIS management console and/or the platform installer. Now on older MS server systems with IIS 7 the management service will be automatically installed with the operating system. In server 2012 it is not and needs to be added via the “roles and features” screens.

feature-01

feature-02

Don’t forget to enable the service after installation.

Configuration

Start the IIS manager application again and next up we will configure a user that is allowed to deploy.

config01

In the next screen you can configure a user, optional connection strings and where to save the profile file. Just filling in the username and leaving the rest at default values, is usually enough for most cases. Make sure that the user you use is a member of the administrator group on the server or the deploy will fail. Make a note of the destination URL in this screen.

Last step: the deploy

Fire up Visual Studio and open a web project. Right click the project and hit “Publish“.

visualstudio01

visualstudio02

Fill in all field in the above screen:

  • Server: the URL of the website or URL of the server hostname
  • Site name: enter the name of the site exacly as you see in the IIS manager (ex: Default Web Site)
  • Username and password: fill these with the user credentials you used in the previous step.
  • Save password: if checked password will be stored (encrypted) in the publish profile xml file.
  • Destination URL: see previous step for this.

Press publish and if all is well your site should be deployed now, happy coding!

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.