microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.51k stars 2.62k forks source link

Azure function "Run from package" deployment not working #10961

Closed SaebAmini closed 5 years ago

SaebAmini commented 5 years ago

Question, Bug, or Feature?
Type: Bug

Enter Task Name: AzureFunctionAppV1 and AzureRmWebAppDeploymentV4

Environment

Issue Description

ZipDeploy deployment for an Azure function, to run it from a package, doesn't work. The task says it completes successfully. The package is uploaded successfully to data/SitePackages, however the advertised packagename.txt file isn't created. When looking at the "Deployment Center" on the portal, it says the deployment failed with a "Failed to deploy to production" message and no additional details:

image

After creating a packagename.txt file manually and pointing to the latest uploaded package, the function is recognized and starts correctly.

Task logs

2019-07-22T04:59:59.9663241Z ##[section]Starting: Azure App Service Deploy: mhg-dev-dayforce-integrations-adp
2019-07-22T04:59:59.9663241Z ==============================================================================
2019-07-22T04:59:59.9663241Z Task         : Azure App Service deploy
2019-07-22T04:59:59.9663241Z Description  : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2019-07-22T04:59:59.9663241Z Version      : 4.3.36
2019-07-22T04:59:59.9663241Z Author       : Microsoft Corporation
2019-07-22T04:59:59.9663241Z Help         : [Learn more about this task](https://aka.ms/azurermwebdeployreadme)
2019-07-22T04:59:59.9663241Z ==============================================================================
2019-07-22T05:00:01.4507070Z ##[warning]Can't find command extension for ##vso[telemetry.command]. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
2019-07-22T05:00:01.4975831Z Got service connection details for Azure App Service:'mhg-dev-dayforce-integrations-adp'
2019-07-22T05:00:06.2338235Z ##[warning]Can't find command extension for ##vso[telemetry.command]. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
2019-07-22T05:00:06.3432021Z Updating App Service Application settings. Data: {"WEBSITE_RUN_FROM_PACKAGE":"1"}
2019-07-22T05:02:12.1764646Z Updated App Service Application settings and Kudu Application settings.
2019-07-22T05:02:12.1764646Z Package deployment using ZIP Deploy initiated.
2019-07-22T05:03:13.7834977Z Successfully deployed web package to App Service.
2019-07-22T05:03:19.1232768Z Successfully added release annotation to the Application Insight : mhg-dev-dayforce-integrations-adp
2019-07-22T05:03:20.9584744Z App Service Application URL: http://mhg-dev-dayforce-integrations-adp.michaelhill.com.au
2019-07-22T05:03:20.9897231Z ##[section]Finishing: Azure App Service Deploy: mhg-dev-dayforce-integrations-adp
SaebAmini commented 5 years ago

This is doing my head in. I haven't been able to do anything to get it to work short of writing a custom script to list the contents of data/SitePackages after the deployment task completes, manually create a packagename.txt pointing to the latest package and upload it.

Here's a complete log file of the release pipeline, with debug turned on: Attempt2.zip

Since the task actually succeeds and gets a 200 from the zip deploy API, I believe this isn't actually a bug with the task, but rather a bug with the Kudo API. So feel free to move this issue to the correct place.

Also, I have a hunch that the function app running inside an ASE could be part of the problem.

vincent1173 commented 5 years ago

@SaebAmini , Can you please open the issue here?