404 Not Found when using Octopus Deploy to push .Net Core to a Linux Azure Web App

azure
(Lianne Crocker) #1

I have a Linux Azure Web App and I’m using the built-in step to deploy an Azure Web App to deploy a .Net Core app. This is failing with a 404:

Retry #3 on Azure deploy. Exception: Could not connect to the remote computer ("XXXXXXXX.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.
Using site 'XXXXXXXX'
Using slot ''
Using ID '91c82c13-db23-4289-b1fb-0fbdf8f661de' for connections to the remote server.
Pre-authenticating to remote agent URL 'https://XXXXXXXX.scm.azurewebsites.net/msdeploy.axd?site=XXXXXXXX' as '$XXXXXXXX'.
Calamari.exe : Microsoft.Web.Deployment.DeploymentDetailedException: Could not connect to the remote computer
("XXXXXXXX.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. ---> System.Net.WebException: The
remote server returned an error: (404) Not Found.

Is there something I’ve missed in the configuration?

(Lianne Crocker) #3

Hi,

Great question!

Octopus Deploy uses Web Deploy within the Deploy Azure Web App Step. In order to get this to work on a Linux Azure Web App you need to add an App Setting on the Web App in Azure. This page has more information: https://docs.microsoft.com/en-us/azure/app-service/containers/app-service-linux-faq#continuous-integration-and-deployment

You can add this setting on the Web App Blade in the Azure Portal, go to Configuration > Application Settings > New Application Setting with name WEBSITE_WEBDEPLOY_USE_SCM and a value of false.

It can also be added in an ARM template (https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2018-11-01/sites/config-appsettings) or using the CLI:

az webapp config appsettings set --settings WEBSITE_WEBDEPLOY_USE_SCM=false -n <WEBAPP-NAME> -g <RESOURCEGROUP-NAME>

Thanks.