Note: Please go to to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > ServerTemplates > v12.11 LTS > ST > Microsoft IIS App Server (v12.11.2-LTS) > Web Deploy Set Up for Windows Web Applications

Web Deploy Set Up for Windows Web Applications





Table of Contents    

Long Term Support


Stable, tested ServerTemplate assets

   ►  Tutorial - Microsoft Web Deploy


To set up and use Web Deploy, a Microsoft tool to simplify deployment of Web applications to IIS servers.


  • Required user roles: 'actor', 'server_login', 'designer'
  • This tutorial assumes that you are connecting the Microsoft SQL database server that was launched with RightScale's "Database Manager for Microsoft SQL" ServerTemplate.
  • This tutorial assumes that you are using a Microsoft Internet Information Services (IIS) web application server that connects to a Microsoft SQL database server that was launched using RightScale's "Database Manager for Microsoft SQL" ServerTemplate. For more information, see Microsoft IIS App Server Setup.
  • We strongly recommend that you set up credentials for password values and any other sensitive data included as RightScript inputs. Also, a few default input values assume that predefined credentials exist, as discussed in Create Credentials for Common Inputs.


Web Deploy (msdeploy.exe) is a tool from Microsoft for web application deployment.  It allows you to export your web application and specify the parameter transformations during deployment. Using this method of code deployment allows your application agnostic ServerTemplates to be used to deploy different apps across multiple production, development, and test deployments. 

For full command line syntax see the following Microsoft technet guide: Web Deploy Command Line Syntax

You can create a msdeploy web package using the export instructions below, or use Visual Studio 2010.


Configure Microsoft IIS App Server for MSDeploy

  1. Import the following Powershell RightScripts for your IIS ServerTemplate from the RightScale MultiCloud MarketPlace:
  2. Go to the Scripts tab of your Microsoft IIS App Server's ServerTemplate and remove the following Boot and Operational PowerShell RightScripts from your IIS ServerTemplate to use MSDeploy. To modify these scripts, make sure the server is not operational:
    • IIS Download application code
    • IIS Add connection string
    • IIS Switch default website
    • IIS Start Default website
  3. Under Operational Scripts, click Add Script and add both the Windows download file from ROS and Windows import MSDeploy package scripts to your ServerTemplate. 
  4. Use the ServerTemplate to add a server to the deployment. If you are actively developing and testing the ServerTemplate you may want to add a server using the HEAD version of the ServerTemplate so that you can add/remove scripts.
  5. Go to your deployment level Inputs tab and make sure the following values are configured:
    • DB_CONNECTION_STRING - The connection string that will be used to initially connect to the database. At a minimum, it should provide the database name. The database connection string will be added to the 'web.config' file of the web application. The value should be a credential since it will likely contain the password for the database server. The credential value should look similar to this example:;Database=MyDBName;User ID=MyDbUser;Password=MyDbPassword;
    • REMOTE_STORAGE_CONTAINER_APP - The name of your S3 or Rackspace Cloud File container used to store your old IIS logs.
    • DOWNLOAD_DIR - The folder where the application file is located. For example, c:\downloads.
    • STORAGE_FILE_NAME - Application file name. It will be downloaded from the remote storage location specified by the STORAGE_CONTAINER_NAME input and downloaded to the local directory specified by the DOWNLOAD_DIR input.
    • REMOTE_STORAGE_ACCOUNT_PROVIDER_APP - Name of Remote Storage provider. Amazon S3, Rackspace Cloud Files, Windows Azure Storage, Softlayer Object Storage or OpenStack Swift.
  6. After configuring your inputs, launch your newly configured Microsoft IIS App Server. Refer to the instructions in Launch a Server if you are not already familiar with this process.
  7. Once your server becomes operational, go the the Scripts tab of your IIS app server and run the Windows download file from ROS and then the Windows import MSDeploy package scripts.
  8. Once complete, you can use Remote Desktop Connection to log in to your running server. For more information, see RDP into a Server.

MSDeploy PowerShell Command Line Examples

The following lists some export (IIS to zip package) and import (zip package to IIS) 'msdeploy' examples that can be run from the PowerShell prompt.

Note: Msdeploy import works only with a msdeploy generated web package.

For more information about PowerShell and RightScripts, see Writing Windows Powershell RightScripts.

Add msdeploy v2 to the PATH
$msdeploy_folder="Microsoft Web Deploy V2"
if ($env:path -notmatch $msdeploy_folder) {
  $env:path="$env:path;c:\Program Files\IIS\$msdeploy_folder"
  [environment]::SetEnvironmentvariable("Path", $env:path, "User")
Simple, export all the contents of a Web server
# Export everything(code, IIS sites, app pools, etc) to c:\
msdeploy -verb:sync -source:webServer -dest:package=c:\
Export one site and app pool
# Export site "App Test" from IIS with the associated app pool. Other extensions available
msdeploy -verb:sync -source:appHostConfig=`"App Test`" -enableLink:AppPoolExtension  -dest:package=c:\
Export multiple sites using a manifest file
# Create the manifest file
echo @"
  <appHostConfig path="Default Web Site"/>
  <appHostConfig path="App Test"/>
"@ | out-file -encoding 'ASCII' c:\manifest.xml

# Export sites specified in the manifest file with associated application pools
msdeploy -verb:sync -source:manifest=c:\manifest.xml -enableLink:AppPoolExtension -dest:package=c:\
Export all sites with the encryptPassword setting
# encryptPassword controls access to encrypted properties in IIS configuration
msdeploy -verb:sync -source:webServer ",encryptPassword=mypasswd"
Export all sites skipping ssl certificate
# Export everything(code, IIS sites, app pools, etc) to c:\
msdeploy -verb:sync -source:webServer -skip:objectname=cert -dest:package=c:\
Export all sites with a web.config Connection String parameter
# Create the parameters file for the export
echo @"
  <parameter name="ConnStringParam" defaultValue="This value will be replaced on import">
    <parameterEntry kind="XmlFile" scope="\\web.config$" match="//connectionStrings/add[@name='MainConnString']/@connectionString" />
"@ | out-file -encoding 'ASCII' .\params_export.xml

# Export all IIS sites with a parameter web.config connection string named 'MainConnString'
msdeploy -verb:sync -source:webServer "-declareParamFile=params_export.xml" -dest:package=c:\
The parameters file from this example matches this section from 'web.config':
    <add name="MainConnString" connectionString="texttext" providerName="System.Data.SqlClient" />
List the package parameters
msdeploy -verb:getparameters -source:package="c:\"
Simple import, sync IIS with content of the package
# sync IIS with the contents of msdeploy -verb:sync -source:package="c:\" -dest:auto
Import zip file packaged with encryptPassword and replace binding object
# Import sites and replace binding IP msdeploy -verb:sync -source:package="c:\,encryptPassword=mypasswd" "-replace:objectName=binding,targetAttributeName=bindingInformation,match='\d+.\d+.\d+.\d+:',replace='*:'" -dest:auto
Import package with parameter
# Create the parameters file
echo @"
  <setParameter name="ConnStringParam" value="$env:DB_NEW_CONNECTION_STRING"/>
"@ | out-file -encoding 'ASCII' .\params_import.xml

# Import all IIS sites by referencing the parameters file
msdeploy -verb:sync -source:package="c:\" "-setParamFile=params_import.xml" -dest:auto

# Or import specifying the parameter to override
msdeploy -verb:sync -source:package="c:\" -setParam:name="ConnStringParam",value="$env:DB_NEW_CONNECTION_STRING" -dest:auto
Import MSDeploy site packages from IIS Manager

Open up the Server Manager, expand Roles and Web Server (IIS) Manager, and click on Internet Information Services. Right-click on your cloud server and navigate to Deploy > Import Server or Site Package...


You must to post a comment.
Last modified
09:40, 2 Jan 2014



This page has no classifications.



© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.