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“
Turn off Windows Firewall to see if the issue occurs again. You can turn it back on after testing. If it works after turning it off, it means there is an issue with the inbound rule.
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 | findstr :8172
Additionally, make sure that IIS Management Service is installed and running:
Finally, go to IIS Manager and open “Management Service”. Make sure that it is running and it is enabled for remote connections.
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
- Reinstall msdepsvc (MS Deploy service for Remote Agent)