2

Issue

We're getting the error:

##[error]Error: Error: Failed to deploy web package to App Service. Error: getaddrinfo ENOTFOUND {appServiceName}.scm.{appServiceEnvironment}.appserviceenvironment.net {appServiceName}.scm.{appServiceEnvironment}.appserviceenvironment.net:443

When running the below pipeline task:

- task: AzureRmWebAppDeployment@4
  enabled: true
  displayName: 'Azure App Service Deploy Zip-file to: $(arm_appServiceFrontend)'
  inputs:
    appType: 'webApp'
    azureSubscription: '$(armServiceConnectorForTestEnvironment)' 
    WebAppName: '$(arm_appServiceFrontend)'
    # the deployment step has a hidden step that downloads the published artifacts but it places the 
    # artifact in the wrong catalogue. To work around that I have to place my self in the correct
    # path below.
    packageForLinux: './../$(publishedArtifactName)/$(frontEndProjectName).zip'

The full output of this task is:

Azure App Service Deploy Zip-file to: {appServiceName}

View raw log

Starting: Azure App Service Deploy Zip-file to: {appServiceName}

==============================================================================

Task : Azure App Service deploy

Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby

Version : 4.184.4

Author : Microsoft Corporation

Help : https://aka.ms/azureappservicetroubleshooting

==============================================================================

Got service connection details for Azure App Service:{appServiceName}

Trying to update App Service Application settings. Data: {"WEBSITE_RUN_FROM_PACKAGE":"1"}

App Service Application settings are already present.

Package deployment using ZIP Deploy initiated.

##[error]Failed to deploy web package to App Service.

##[error]Error: Error: Failed to deploy web package to App Service. Error: getaddrinfo ENOTFOUND {appServiceName}.scm.{appServiceEnvironment}.appserviceenvironment.net {appServiceName}.scm.{appServiceEnvironment}.appserviceenvironment.net:443

App Service Application URL: http://{appServiceName}.appserviceenvironment.net

Finishing: Azure App Service Deploy Zip-file to: {appServiceName}

Note: content in curly braces is where I've replaced deployment specific strings with generic names.

Context

One of our teams has started using Azure DevOps pipelines to deploy code in a GitHub repo to an App Service in an App Service Environment.

We're using the App Service Environment because the app requires access to resources in our private network (internal API and LDAP servers).

The app itself is exposed publicly, though this is done via an Application Gateway, with the app service configured as the backend pool, rather than the app service being public facing.

Since we're deploying to a private ASE, we've created our own Azure Scale Set Release Agent, using an image created from the MS Ubuntu 2004 agent.

A lot of components in this tech stack are new to all members of the team; so it's very likely we've done something wrong somewhere; but our lack of experience with these tools means we're not sure where...

Question

Does anyone know of a likely cause for the error we're seeing?

Failing that, any tips on useful steps to help us track the source of these issues would be appreciated.

2 Answers 2

2

The official solution is documented here: MS Docs: Create ILB ASE - DNS Configuration

You need to have DNS entries for your ASE so that the deployment task can reach it; but if you have an internal only ASE, those entries aren't created in public DNS, and MS don't manage private DNS.

MS propose creating the DNS entries in your internal DNS:

Create Zone {ASE Name}.appserviceenvironment.net

  • Type: Primary Zone
  • Store the zone in AD: True
  • Zone Replication: To all DNS servers in the domain
  • Zone Name: {ASE Name}.appserviceenvironment.net
  • Allow only secure updates: true

Create A Record under {ASE Name}.appserviceenvironment.net

  • Name: *
  • IP: {ASE's Private IP}

Create A Record under {ASE Name}.appserviceenvironment.net

  • Name: *
  • IP: {ASE's Private IP}

Create Child Zone under {ASE Name}.appserviceenvironment.net

  • Name: scm

Create A Record under scm.{ASE Name}.appserviceenvironment.net

  • Name: *
  • IP: {ASE's Private IP}

However, whilst awaiting the DNS creation I tried a workaround which turned out to be sufficient for the pipeline's needs...

Add the below script to your pipeline, ahead of the deployment task:

- script: |
    sudo -- sh -c -e "echo '{ASE's Private IP}    {ASE Name}.appserviceenvironment.net' >> /etc/hosts";
    sudo -- sh -c -e "echo '{ASE's Private IP}    scm.{ASE Name}.appserviceenvironment.net' >> /etc/hosts";
    sudo -- sh -c -e "echo '{ASE's Private IP}    {AppName}.scm.{ASE Name}.appserviceenvironment.net' >> /etc/hosts";
  displayName: 'Fake DNS entries required for deployment'

HOWEVER; the above fix only fixes the pipeline's deployment.

The FQDN for the app service is still not present; and the IP alone won't work since all apps on the ASE will have the same IP / we need hostname resolution. In our case we had an AppGateway in front of the app service; so you could pick the app service you're after from the list... but that's resolved to an FQDN, which then fails as the AppGateway can't resolve that FQDN to an IP... So you do need your DNS to be updated.

Whilst testing the service / awaiting DNS changes, our developers just updated their local device's hosts files to work around that issue: {ASE's IP} {appServiceName}.{ASE Name}.appserviceenvironment.net

1

Select the Default agent pool in the Releases Run on agent - Agent pool field. It appears this gets set to another value when creating a new release. Once Agent pool was set to Default, the error went away.

Error should go away

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.