Azure-pipelines-tasks: Azure App Service Deploy failed when app settings are provided

Created on 9 Jan 2018  路  9Comments  路  Source: microsoft/azure-pipelines-tasks

Troubleshooting

Can not completly deploy web app on Azure (when app settings are set).

Environment

  • VSTS
  • Agent queue : Hosted VS 2017

Issue Description

I have a release definition with a task _Azure app service deploy_ that deploy an node application on a Linux web app.
I simply defined these properties for my task :

  • Azure subscription : {my subscription}
  • App type : Linux web app
  • Image source : Built-in image
  • Package or folder : {archive issued from my artifact}
  • Runtime stack : Node.js 6.11
  • Startup command : index.js

and all worked fine.

Next I added this property :

  • App settings : -port 3000

and now, my release fails with the error message below.

Error logs

2018-01-08T23:02:19.3795329Z ==============================================================================
2018-01-08T23:02:19.3795580Z Task         : Azure App Service Deploy
2018-01-08T23:02:19.3796029Z Description  : Update Azure WebApp Services On Windows, Web App On Linux with built-in images or docker containers, ASP.NET, .NET Core, PHP, Python or Node based Web applications, Function Apps, Mobile Apps, Api applications, Web Jobs using Web Deploy / Kudu REST APIs
2018-01-08T23:02:19.3796296Z Version      : 3.3.32
2018-01-08T23:02:19.3796447Z Author       : Microsoft Corporation
2018-01-08T23:02:19.3796624Z Help         : [More Information](https://aka.ms/azurermwebdeployreadme)
2018-01-08T23:02:19.3796992Z ==============================================================================
2018-01-08T23:02:21.8951430Z Got connection details for Azure App Service:'XXXXXXXX'
2018-01-08T23:03:16.6980813Z Deploying web package : d:\a\r1\a\build\drop\xxxxx.zip at virtual path (physical path) : / (/site/wwwroot)
2018-01-08T23:05:05.6081198Z Successfully deployed package d:\a\r1\a\build\drop\xxxxxx.zip using kudu service at XXXXXXX.scm.azurewebsites.net:443
2018-01-08T23:05:06.6020923Z Successfully deployed web package to App Service.
2018-01-08T23:05:06.6414953Z ##[error]Error: Failed to update the App settings. Error: TypeError: updateAppSettings is not a function.
2018-01-08T23:05:10.2373084Z Successfully updated deployment History at https://XXXXXXXXX.scm.azurewebsites.net/api/deployments/81515452706625
2018-01-08T23:05:10.2610356Z ##[section]Finishing: Deploy Azure App Service
AzureAppService Release

Most helpful comment

@davidobrien1985 Thanks for sharing logs.

The error in logs:

2018-07-03T05:03:02.8023453Z ##[error]Error: Failed to fetch Kudu App Settings. Error: unable to get local issuer certificate
2018-07-03T05:03:02.8035598Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Failed to fetch Kudu App Settings. Error: unable to get local issuer certificate

To use a certificate in App Service, the certificate must be signed by a trusted certificate authority. If your web app gives you certificate validation errors, you're probably using a self-signed certificate and to resolve them you need to set a variable named VSTS_ARM_REST_IGNORE_SSL_ERRORS to the value true in the build or release pipeline.

All 9 comments

@aydey can you work on this

Hey,
Can you still repro the issue. I tried to repro the issue, but failed, Also can you attach the entire log-file after setting "system.debug" as "true" in the variables.

Closing this issue, as there has been no response from the customer.

@aydey I am hitting the same issue now.
I deploy an API to App Services (inside an ASE) with the VSTS "Azure App Service Deploy" task and all is fine. I then add "App Settings" to the task and it fails with
##[error]Error: Failed to fetch Kudu App Settings. Error: unable to get local issuer certificate

Any idea why this is happening?

In order to get the deployment working I had to add -allowUntrusted to the webdeploy step.

Thanks,
David

@davidobrien1985 Thanks for reaching out. Can you please share debug logs to [email protected]? (On the Variables tab, add system.debug, set it to true and run the release to generate debug logs)

@SumiranAgg done, thanks.

@davidobrien1985 Thanks for sharing logs.

The error in logs:

2018-07-03T05:03:02.8023453Z ##[error]Error: Failed to fetch Kudu App Settings. Error: unable to get local issuer certificate
2018-07-03T05:03:02.8035598Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Failed to fetch Kudu App Settings. Error: unable to get local issuer certificate

To use a certificate in App Service, the certificate must be signed by a trusted certificate authority. If your web app gives you certificate validation errors, you're probably using a self-signed certificate and to resolve them you need to set a variable named VSTS_ARM_REST_IGNORE_SSL_ERRORS to the value true in the build or release pipeline.

@SumiranAgg thanks, that did the trick! Is that variable documented anywhere?

@davidobrien1985 Glad to know this helped.
When this error occurs we will provide a better guidance message which provides these details. Already checked in master.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheRealEdwardCullen picture TheRealEdwardCullen  路  3Comments

timfish picture timfish  路  3Comments

fedemkr picture fedemkr  路  3Comments

ThomasBarnekow picture ThomasBarnekow  路  3Comments

alexszilagyi picture alexszilagyi  路  3Comments