Tallan Blog

Tallan’s Experts Share Their Knowledge on Technology, Trends and Solutions to Business Challenges

Deploying a Site to an Azure VM using Web Deploy


Deploying to an Azure VM is a seemingly simple and easy process, but there are many steps, and thus many places to make mistakes.  Recently I discovered that many, if not all, of the online resources detailing this process are either incomplete or severely outdated.  Here I will outline the configuration and deployment process with up to date information, including instructions pertaining to the new Microsoft Azure Portal.

To get started, you will need a few things that this tutorial does not cover. This tutorial assumes that your Azure VM is already provisioned, deployed, and running IIS (Internet Information Services). The VM should be running Windows Server 2012 R2 or later.  This also assumes that you have administrator access to the Azure Subscription associated with the VM.

Configuring IIS on the Virtual Machine:

First, we’re going to need to install some IIS features.  To assist in doing that, we are going to use Web Platform Installer (WPI). Once you have WPI downloaded and installed, run it and use the search feature to add “IIS Management Service,” “Web Deploy 3.6 without bundled SQL support,” and “IIS: ASP.NET 4.5.” Once those items have been added, click “Install” on the bottom right. You should see a window showing the items added. Click “I Accept” and the items will be installed.


Once these are installed, open IIS Manager.  You should now see an icon for “Management Service.” management service

Double click this icon. Here we can update the management settings. To edit settings, the IIS service will need to be stopped, so stop it now. Check the box on the top labeled “Enable Remote Connections.”  Note that under the Connections section, port 8172 is specified. This is the default port that IIS will use, and to keep things simple, this tutorial will use the default port.


Now click “Apply” on the right side of the window to Apply the change and restart the service.

Note that this process should have automatically created this inbound rule on your VM’s firewall.


This rule will allow traffic on port 8172, the port we will be using for deployments.

Now that IIS is configured for Web Deploy, we can make the appropriate changes to the VM through the Azure portal.

Creating Network Security Rules for Azure:

Navigate to the Azure Portal and sign in then locate your VM.  Once your VM is selected, click on “Network Interfaces” under the Settings section and select your VM’s network interface.



From the network interface, select “Network Security Group” and navigate to your security group.



Here we can edit our network security rules. We need to create a rule that will allow web deployments. To do so, click on “Inbound Security Rules” and then click the Add button.  For our new rule, we want to allow action on port 8172.


One the rule has been created, we are ready to create our publish profiles and deploy.

Web Deploy via Visual Studio

Start by opening your solution containing the web project you wish to deploy in Visual Studio.  Right click on your project and select “Publish.”  When asked to select a publish target, click on Custom and give your publish profile a name. You should now be at a window where you can fill in the details for your deployment.


In the Server field, enter the address of you VM, but note that it must be accessed with https not http. Web Deploy is a secure process and must be done using the secure protocol.

For the Site Name, enter the name of the site that you would like to publish to in IIS.

Username and Password should be valid login credentials to your VM.

Finally, Destination URL will be the address of your VM again, but this time https is not required.

If validating the connection succeeds, you can now click “Publish” to deploy the code to your target machine.


The final steps are complete and you have now successfully published your site. It should now be up and running on the VM.  If you would like to confirm this, you can remote onto the VM and navigate to the directory for the IIS Site.  Here you should see the newly deployed files for your site.  Publishing the code once will save all of the settings in a Publish Profile, so in the future you will be able to reuse this profile and deploy anytime with just one click.

To learn more on how Tallan’s Cloud technologists can help your organization enhance productivity, streamline costs, while optimizing data security to modernize your business.

Share this post:

7 Comments. Leave new

Anthony DiVanna
May 5, 2017 10:58 am

Concise yet insightful read!

Thanks so much! You are right tutorials were all out of date. The did not think we would need to edit the generated code for server name.

David Hogeling
January 25, 2018 4:03 am

Thanks. I tried all these steps and everything is set according to this article.
I saw a few minor deviations with my (european) environment.
– Under Azure I got Settings/Networks (i.s.o. network security group).
– Rules for incoming ports: name cannot be set but defaults to Port_8172.

Disabled my firewall, but validation still gives the following error:

Microsoft Visual Studio
Could not connect to the remote computer (""). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE. Unable to connect to the remote server

Be sure to use “Default Web Site” as the site name in the web deploy window on Visual Studio. I don’t remember the error I was getting but it wasn’t the least bit indicative of the problem.

Good post it saved me hours of work

I find it amazing that Microsoft cannot make this simpler. I have spent a few hours trying to get this working….and every time I install a new VM it *always* takes another few hours and lots of frustration. For what it is worth, your instructions didn’t help. But I will persist after more sleep or more likely deploy manually to the VM until I am less frustrated. I have done this at least 20 times over the last 10 years and it never gets easier.

Thanks a lot for this guide. I’m able to deploy using http for the Server field in VS2019, but if I used https, I get the ERROR_DESTINATION_NOT_REACHABLE. I am deploying to AWS hosted server and I don’t want to use an unsecure connection. I do have a digital certificate installed and can connect to my website using https just fine. Any ideas?

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>