Unable to deploy to staging slot with ERROR_DESTINATION_NOT_REACHABLE error

jsladovic 21 Reputation points
2022-01-05T15:56:34.637+00:00

Hi,

We're running a Linux App Service (a .Net Core 3.0 App), deployments to which are handled through our Azure pipeline. The agents running the builds are located on a remote machine. When we added a staging environment, we tried to set up a build pipeline the same way, but the deployment fails with the following error during the Azure App Service deploy job:

##[error]Error: Error Code: ERROR_DESTINATION_NOT_REACHABLE

The error appears after the following line in the deploy job:

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='F:\{agent_name}\_work\1\a\WebApp.zip' -dest:auto,ComputerName='https://{app-name}-staging.scm.azurewebsites.net:443/msdeploy.axd?site={app-name}',UserName='${app-user}__staging',Password='***',AuthType='Basic' -setParam:name='IIS Web Application Name',value='{app-name}' -enableRule:AppOffline -retryAttempts:6 -retryInterval:10000 -enableRule:DoNotDeleteRule -userAgent:VSTS_c18b017a-a9ee-4d9f-bd98-73b915148620_build_119_0

The main difference between here and the production pipeline which works is in the computer name parameter. The computer name for the production deployment is: https://waws-prod-am2-403.publish.azurewebsites.windows.net:443/msdeploy.axd?site={app-name}

My best guess would be that there is an issue with the connection from the deployment server to the staging server, but I'm not sure which checks I should perform there.

The Azure App Service deploy task is configured as such:

- task: AzureRmWebAppDeployment@4
  inputs:
    ConnectionType: 'AzureRM'
    azureSubscription: '{subscription name}({subscription ID})'
    appType: 'webApp'
    WebAppName: '{app-name}'
    deployToSlotOrASE: true
    ResourceGroupName: '{resource-group-name}'
    SlotName: 'staging'
    packageForLinux: '$(Build.ArtifactStagingDirectory)/*.zip'

The production pipeline is set up identically, with only the slot name being changed to "production". The pipeline variables, if there's any need for them are:

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

Please do ask if there's anything else I need to share about this issue.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,968 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-01-06T08:45:50.427+00:00

    @jsladovic ,

    Thanks for reaching out to Q&A.

    Looking at the working and non - working scenario , the hostname endpoint is different. For the Production slot, the endpoint name is "stampname.publish.azurewebsites.net" (stamp name of the web app) and for staging it is "{app-name}-staging.scm.azurewebsites.net"

    Please add this app setting "WEBSITE_WEBDEPLOY_USE_SCM" and set it to "false". Set to false for WebDeploy to stop using the Kudu deployment engine. The endpoint will change during the deployment. Also please keep this app setting specific to Staging slot.

    https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#deployment

    I hope this helps!

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.