Could not reach the Web Deploy endpoint

This post has been republished via RSS; it originally appeared at: IIS Support Blog articles.

You can publish your website directly to an Azure Virtual Machine by using Visual Studio. However, you may run into this error message after selecting the VM: “Could not reach the Web Deploy endpoint on the specified virtual machine

 

Solution

The machine Visual Studio is trying to connect should be listening the port 8172. Run the following command in the target VM to see if it is listening to this port:

netstat -ano

Additionally, make sure that IIS Management Service is installed and running:

 

22.png

Finally, go to IIS Manager and open “Management Service”. Make sure that it is enabled for remote connections.

33.png

 

A related error: “Could not verify the server’s certificate”

After solving previous error, you may run into another issue while trying to publish the web application:

 

Web deployment task failed. (Connected to the remote computer (“testsite.azure.com”) using the specified process (“Web Management Service”), but could not verify the server’s certificate. If you trust the server, connect again and allow untrusted certificates. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.)

 

 

Here is the solution:

  • Check “Allow untrusted” option in the Publish wizard (if it is available - Reference)
  • Add the following lines to your publish profile (Publish profiles are located in C:\Users\username\source\repos\applicationname\Properties\PublishProfiles:(

 

<UseMSDeployExe>true</UseMSDeployExe><AllowUntrustedCertificate>true</AllowUntrustedCertificate>

 

  • Reinstall msdepsvc (MS Deploy service for Remote Agent)

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.