Debugging Azure Function App deployment failure in Azure DevOps pipeline: ZIP Deploy error with VNet-integrated app

Melvin Tran 40 Reputation points
2024-10-01T08:13:36.17+00:00

I'm encountering an error when deploying an Azure Function App (Python) through Azure DevOps pipelines. The app is VNet-integrated, and the deployment fails with a ZIP Deploy error. Here are the details:

Error message:

Got service connection details for Azure App Service:'func-****-dev' 

NOTE: Function app is VNet integrated. Updating App Service Application settings. 

Data: {"WEBSITES_ENABLE_APP_SERVICE_STORAGE":"true","WEBSITE_RUN_FROM_PACKAGE":"0"} App Service Application settings are already present. Package deployment using ZIP Deploy initiated. Fetching changes. Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/******.zip (0.05 MB) to /tmp/zipdeploy/extracted 

##[error]Failed to deploy web package to App Service. ##[warning]Can't find loc string for key: KuduStackTraceURL ##[error]KuduStackTraceURL https://*****-dev__staging:***@func-****-dev-staging.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace ##[error]Error: Package deployment using ZIP Deploy failed. Refer logs for more details. Successfully added release annotation to the Application Insight : appi-*****-dev Successfully updated deployment History at https://*****-dev-staging.scm.azurewebsites.net/api/deployments/***** App Service Application URL: https://******-dev-staging.azurewebsites.net


We've identified that the issue was related to the requirements.txt file. Rolling back to an older version of the file (which included extra, unused packages) resolved the problem. However, we'd like to understand:

  1. Why does this error occur, and how can we properly debug it in the future?
  2. Is it possible to SSH into the SCM console for a VNet-integrated Function App? If so, what specific logs or areas should we investigate to troubleshoot similar issues?
  3. Are there any best practices for managing requirements.txt for Azure Function Apps, especially when the app works locally but fails during deployment?
  4. How can we reconcile the difference between local execution (which works fine) and deployment behavior?

Any insights or troubleshooting steps would be greatly appreciated. Thank you!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,908 questions
0 comments No comments
{count} votes

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.