简体   繁体   中英

Web deployment to Azure VM failed

I am currently following the tutorial here to deploy an ASP.NET app to my Azure VM using Visual Studio. There are two pre-requisites listed for the tutorial; I fulfill them both.

Unfortunately, I keep encountering this error:

Web deployment task failed. (Could not connect to the remote computer ("XXX.westeurope.cloudapp.azure.com") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC .)

Running the command net start wmsvc gives me the following response:

The requested service has already been started.

When I run netstat -an , I can verify that Port 8172 (to which I am trying to deploy my ASP.NET app) is listening:

TCP 0.0.0.0:8172 0.0.0.0:0 LISTENING

I have also ensured that there is an inbound security rule inside my firewall to allow all connections to Port 8172 via TCP. On my Azure portal, I have added the same security rule too.

Any ideas on how I may fix this issue?

you are probably missings and Azure Network Security Group (NSG) rule to allow such traffic to the vm, one way to test this is do something like this from your workstation:

Test-NetConnection XXX.westeurope.cloudapp.azure.com -Port 8172

if that doesnt work, your NSG is blocking the traffic (most likely). You can consult this article to open ports on NSG.

After hours of trial and error (along with copious amounts of Googling), I managed to fix the issue.

The information provided by the tutorial here is incomplete/inaccurate. It is not sufficient to install Web Deploy simply by following the instructions given -- in fact, the claim that "Once Web Deploy is installed, the Web Management Service is started and set to automatic startup " (my emphasis) is false. Here is a screenshot taken from the IIS tab in Server Manager :

在此处输入图片说明

As you can see, the Start Type of Web Management Service is Manual .

After downloading and installing Web Deploy 3.6 , one has to go to Programs and Features , find Microsoft Web Deploy , and then right-click and select Change . Click Next on the first page, then Change on the second page, and one will come across this window:

在此处输入图片说明

Make sure that both IIS 7 Deployment Handler (as well as everything beneath it) and Remote Agent Service are selected.

Once that is done, when one navigates to Server Manager and click on the IIS tab, one will see that both the Web Management Service and the Web Deployment Agent Service are now running automatically:

在此处输入图片说明

Having done all these, one can now deploy an ASP.NET app directly on an Azure VM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM