
Description
Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: AzureFunctionApp@1
Environment
-
Azure Pipelines
- If using Azure Pipelines, provide the account name, team project name, build definition name/build number:
- msasg
- Bing_UX
- FastPath-Build-Test-Deploy-ALL
- https://dev.azure.com/msasg/Bing_UX/_build/results?buildId=17945565
- If using Azure Pipelines, provide the account name, team project name, build definition name/build number:
-
Agent - Hosted or Private: Hosted
- If using Hosted agent, provide agent queue name: vmImageName: 'windows-latest'
Issue Description
We are an internal Microsoft team and we are using the AzureFunctionApp@1 task to deploy our Function Apps in Azure. The issue consists in that many deployments of the App fail due to timeouts and failed retries.
It seems that the request to update the Function App package gets stuck and timeouts after around 3 mins (I guess this timeout is configured inside the task code) and after each timeout retries the request. This is retried several times and at the end, the task fails after 15-16 mins.
What we see in the task log is this:
This produces two issues:
- First, the deployment fails.
- Second, the Function App is left in a corrupted state where the new package has not been fully deployed, and the previous deployment is also broken, which results in the Function App not working anymore and required manual intervention.
We would like to know the root cause of this issue and also if it is possible to have some control from the AzureFunctionApp@1 input parameters to determine the duration of the timeouts and also the number of retries.
Also, the logs don't provide much detail on what the actual problem is.
Error logs
2021-01-07T23:53:09.2386187Z ##[section]Starting: Deploy Function App to PROD
2021-01-07T23:53:09.2639113Z ==============================================================================
2021-01-07T23:53:09.2639707Z Task : Azure Functions
2021-01-07T23:53:09.2640303Z Description : Update a function app with .NET, Python, JavaScript, PowerShell, Java based web applications
2021-01-07T23:53:09.2640877Z Version : 1.163.7
2021-01-07T23:53:09.2641270Z Author : Microsoft Corporation
2021-01-07T23:53:09.2641786Z Help : https://aka.ms/azurefunctiontroubleshooting
2021-01-07T23:53:09.2642356Z ==============================================================================
2021-01-07T23:53:13.6702075Z Got service connection details for Azure App Service:'FastPathBasketballUx-prod4-east-us'
2021-01-07T23:53:15.0324558Z Trying to update App Service Application settings. Data: {"WEBSITE_RUN_FROM_PACKAGE":"1"}
2021-01-07T23:53:15.0326563Z Deleting App Service Application settings. Data: ["WEBSITE_RUN_FROM_ZIP"]
2021-01-07T23:53:15.3156558Z App Service Application settings are already present.
2021-01-07T23:53:21.9654603Z Package deployment using ZIP Deploy initiated.
2021-01-07T23:59:48.4868777Z ##[error]Failed to deploy web package to App Service.
2021-01-07T23:59:48.4977429Z ##[error]To debug further please check Kudu stack trace URL : https://$FastPathBasketballUx-prod4-east-us:***@fastpathbasketballux-prod4-east-us.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace
2021-01-07T23:59:48.4981635Z ##[error]Error: Error: Failed to deploy web package to App Service. Conflict (CODE: 409)
2021-01-07T23:59:49.3382971Z App Service Application URL: http://fastpathbasketballux-prod4-east-us.azurewebsites.net
2021-01-07T23:59:49.3797056Z ##[section]Finishing: Deploy Function App to PROD