Deploying VS 2010 Projects to Amazon EC2

posted Apr 11, 2012, 9:37 AM by Eric Patrick   [ updated Apr 24, 2012, 10:36 AM ]
As we migrate to the Amazon cloud, we shall use Visual Studio's "Publish - Web Deploy" feature. This basically has VS communicate with IIS, installing changed files, removing unused files, and optionally setting directory permissions and such.

To make Web Deploy work, you need to configure the server, and then create a Publish profile in Visual Studio.

Configuring the Server
  1. IIS needs to have the Web Deployment Installation Tool installed; be sure to install the complete suite of tools
  2. The Amazon EC2 instance must be part of a Security Group allowing connections over port 8172 (see the QBO DEV security group for an example)
  3. There should be a Windows account in your name on the machine (e.g epatrick)
Note: if the server is created from the QBO Standard Amazon Machine Image (AMI), this configuration has already been done. You only need to add your Windows account.

Configuring Visual Studio
  1. Choose an application to publish (e.g. qbo.ApplicationWeb), right-click and choose Publish
  2. Publish Profile: choose 'New Profile' from the dropdown list, and enter the name of the site you are publishing to (e.g.
  3. Publish Method: 'Web Deploy'
  4. Service URL: https://{site url}:8172/MsDeploy.axd (e.g.
  5. Site/Application: name of website (from IIS), and optionally folder (e.g. 'Default Web site/qbo3')
  6. Mark as IIS application on destination: checked
  7. Leave extra files on destination: checked
  8. Credentials:
    1. Allow untrusted certificate: checked
    2. User name: enter a Windows account you created during the server setup step 3
    3. Password: enter the password you created during the server setup step 3