Svenska Svenska | English English

Azure Linux Publish Error (Web deployment task failed. Could not connect to the remote computer)

Johan Åhlén by Johan Åhlén • Updated

Azure App Service on Linux was released by Microsoft in 2017. It makes it easy to run your website on ASP.NET Core, Node.js, PHP, Ruby or you own custom Docker Container.

Most people (including me) run into this common problem the first time they try to deploy a Linux Web App. This is easily solved. I will show you how.

Web deployment task failed. Could not connect to the remote computer.

Web deployment task failed. (Could not connect to the remote computer ("linuxtest1.scm.azurewebsites.net"). 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.) The requested resource does not exist, or the requested URL is incorrect.

This is how you solve the problem

1. Go into the Azure Portal ≫ Your App Service ≫ Settings ≫ Configuration ≫ Application Settings.
2. Add a new setting under Application Settings: WEBSITE_WEBDEPLOY_USE_SCM and set the value to false. Leave "Deployment slot setting" blank. Don't forget to click Save.

Azure Linux Web App Configuration disable SCM

3. Now download a new updated publishing profile for Visual Studio.

Azure Web App get publish profile

4. Import the publish profile in Visual Studio. Voila! Your problem should be solved!

What does the WEBSITE_WEBDEPLOY_USE_SCM setting actually do?

Windows Azure Websites comes with SCM, an extension/plugin, that enhance the manageability of the website. This includes the Kudu dashboard (also known as the SCM dashboard) that includes many nifty tools, such as:

You can access the Kudu dashboard by visiting https://{site name}.scm.azurewebsites.net (or by going to Developer Tools ≫ Advanced Tools in the Azure Portal).

Kudu/SCM is available both for Windows Web Apps and Linux Web Apps in Azure.

SCM is also used by default for publishing your web apps. However, this seems to not be working for Linux Web Apps, so you need to use the legacy deployment endpoint instead. This is what WEBSITE_WEBDEPLOY_USE_SCM = false actually does.

Azure Azure Web Apps App Service on Linux

More about Azure

Running a Blog on Azure Data Lake
Setup Caching on your Azure Storage Blobs
Azure Web App Not Updating After Publish

More about Azure Web Apps

Azure Web App Not Updating After Publish
How To Run Your Azure Web App From Zip Package
WEBSITE_DYNAMIC_CACHE and WEBSITE_LOCAL_CACHE_OPTION

More about App Service on Linux

Azure Web App Not Updating After Publish
How To Run Your Azure Web App From Zip Package