将Git仓库纳入requirements.txt时Python Azure函数部署失败
我使用VS Code及Azure Functions扩展创建并部署Python HTTP触发型Azure函数,遇到以下问题:当requirements.txt中包含Git仓库引用时,部署会无明确错误地失败;移除该引用后,部署即可成功。
requirements.txt内容
azure-functions numpy git+https://github.com/my/3rdPartyRepo.git@main
VS Code部署错误提示
22:04:41 MyFunctionApp: Generating summary of Oryx build 22:04:41
MyFunctionApp: Deployment Log file does not exist in
/tmp/oryx-build.log 22:04:41 MyFunctionApp: The logfile at
/tmp/oryx-build.log is empty. Unable to fetch the summary of build
22:04:41 MyFunctionApp: Deployment Failed. deployer =
ms-azuretools-vscode deploymentPath = Functions App ZipDeploy. Extract
zip. Remote build. 22:05:07 MyFunctionApp: Deployment failed.
Azure CLI部署错误提示
使用命令 az functionapp deployment source config-zip -g dev-myapp -n myfunctionAppInAzureName --src myfunctionApp.zip --build-remote 部署zip文件时,得到错误:
Zip deployment failed. {'id': '3811f2d3-73f1-423d-ad6e-81e7f6125c3d',
'status': 3, 'status_text': '', 'author_email': 'N/A', 'author':
'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push
deployment', 'progress': '', 'received_time':
'2023-01-01T18:36:05.0549119Z', 'start_time':
'2023-01-01T18:36:06.0940945Z', 'end_time':
'2023-01-01T18:36:42.9062073Z', 'last_success_end_time': None,
'complete': True, 'active': False, 'is_temp': False, 'is_readonly':
True, 'url':
'https://myfunctionAppInAzureName.scm.azurewebsites.net/api/deployments/latest',
'log_url':
'https://myfunctionAppInAzureName.scm.azurewebsites.net/api/deployments/latest/log',
'site_name': 'myfunctionAppInAzureName'}. Please run the command az
webapp log deployment show -n myfunctionAppInAzureName -g dev-myapp
打开提示中的两个链接,均显示无最新部署及日志。
已尝试的操作
- 删除并重新创建函数应用
- 将Python版本从3.8切换至3.9
- 本地通过pip安装该Git仓库依赖无问题,安装方式为仓库所有者推荐
求助
请问如何解决此问题?如何查看部署失败的真实错误原因?
内容的提问来源于stack exchange,提问作者vsarunov

