Skip to main content

(Solved) Could not reach the Web Deploy endpoint on the specified virtual machine

By using Visual Studio, you can publish your website directly to an Azure Virtual Machine. After selecting the VM in the Publish wizard, you may come across this error message: “Could not reach the Web Deploy endpoint on the specified virtual machine

Could not reach the Web Deploy endpoint on the specified virtual machine error

Solution for “Could not reach the Web Deploy endpoint” error

In order for Web Deploy to access a virtual machine, that machine should be listening the port 8172. Run the command below in the VM to see if it is listening to this port:

netstat -ano

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

Install IIS Management Service to solve "Could not reach the Web Deploy endpoint" error

Finally, go to IIS Manager and open “Management Service”. Check if it is enabled for remote connections.

Enable IIS Management Service to solve "Could not reach the Web Deploy endpoint" error

Are you seeing “Remote Debugging Monitor (MSVSMON.EXE)” error while publishing your project in Visual Studio? Here is the solution: Solved: “Remote Debugging Monitor (MSVSMON.EXE)” error while running a Visual Studio project

“Could not verify the server’s certificate” error

After solving the “Could not reach the Web Deploy endpoint” error, we 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.) Connected to the remote computer (“technewsinfo.centralus.cloudapp.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.The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.The remote certificate is invalid according to the validation procedure.

In order to solve this issue:

  • Check “Allow untrusted” option in the Publish wizard if it is available (Reference)
  • Add the lines below to your publish profile (Located in C:\Users\username\source\repos\applicationname\Properties\PublishProfiles):
<UseMSDeployExe>true</UseMSDeployExe>
<AllowUntrustedCertificate>true</AllowUntrustedCertificate>
  • Reinstall msdepsvc (MS Deploy service for Remote Agent)

Is your Azure Virtual Machine receiving too many requests from a certain IP address? Check this post out: IIS receives too many requests from the user-agent Edge+Health+Probe

2 thoughts to “(Solved) Could not reach the Web Deploy endpoint on the specified virtual machine”

Leave a Reply

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