Azure Publish Error; Web deployment task failed. (Could not connect to the remote computer [...])
I recently encountered a connection problem while publishing an application service to Azure from behind my employer’s firewall. Here is the complete error message:
Error 1 Web deployment task failed. (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.)
This is obviously a showstopper that hinders you from getting your site published to the public cloud from your employer’s company domain. Fear not though, as there is a solution to this; by disabling SCM. The solution is based on an answer from Patrick McCurley at StackOverflow:
- Go to the Azure Portal.
- Click on App Services.
- Click on your application service.
- Click on Application settings.
- Scroll down to Application settings.
- Click Add new setting, and add the following entry:
Name: WEBSITE_WEBDEPLOY_USE_SCM, Value: false
- Click on Save and close the Application settings window.
- Click on your application service.
- Download the publish profile by clicking on Get publish profile.
- Import the publish profile when publishing your application service to Azure from Visual Studio.
This effectively disables SCM and enables you to publish your application service to Azure.