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

Azure App Service on Linux lanserades av Microsoft under 2017. Det gör det enkelt att köra din website på ASP.NET Core, Node.js, PHP, Ruby eller din egen custom Docker Container.

De flesta användare (inklusive mig) stöter på detta vanliga problem den första gången de försöker publicera en Linux Web App. Detta är enkelt löst. Jag skall visa dig hur.

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.

Så här löser du problemet

  1. Gå till Azure Portal ≫ Your App Service ≫ Settings ≫ Configuration ≫ Application Settings.
    2. Lägg till en ny inställning under Application Settings: WEBSITE_WEBDEPLOY_USE_SCM och sätt värdet till false. Lämna "Deployment slot setting" blank. Glöm inte att klicka på Save.
Azure Linux Web App Configuration disable SCM
  1. Ladda nu ned en uppdaterad publishing profile för Visual Studio.

Azure Web App get publish profile4. Importera denna publish profile i Visual Studio. Voila! Ditt problem skall vara löst!

Vad gör WEBSITE_WEBDEPLOY_USE_SCM inställningen egentligen?

Windows Azure Websites har något som heter SCM, en extension/plugin, som förbättrar administrationsmöjligheterna för websiten. Detta inkluderar Kudu dashboard (också känd som SCM dashboard) som har många användbara verktyg, såsom:

  • Komma åt dina website filer
  • Komma åt loggar
  • Ansluta genom SSH/Bash/Command Prompt
  • Komma åt System Info, App Settings, Environment Variables and HTTP Headers

Du kan komma åt Kudu dashboard genom att besöka https://{site name}.scm.azurewebsites.net (eller genom att gå till Developer Tools ≫ Advanced Tools i Azure Portalen).

Kudu/SCM är tillgänglig för både Windows Web Apps och Linux Web Apps i Azure.

SCM används by default för att publicera dina web apps. Tyvärr verkar detta inte fungera för Linux Web Apps, så du måste använda en legacy deployment endpoint istället. Detta är vad WEBSITE_WEBDEPLOY_USE_SCM = false åtgärdar.

Relaterade Artiklar