简体   繁体   English

Azure Devops 部署 Python Azure Z86408593C34AF77FDD90DF923

[英]Azure Devops deploying Python Azure Function not working

I Have a YAML pipeline line within Azure DevOps to build and deploy some python to an Azure Function. I Have a YAML pipeline line within Azure DevOps to build and deploy some python to an Azure Function.

The YAML is auto generated from selecting "Python Function App To Linux On Azure". YAML 是通过选择“Python Function App To Linux On Azure”自动生成的。 It then asks me to select the subscription and azure function and that is it.然后它要求我订阅 select 和 azure function 就是这样。

When it deploys to the Azure Function and I try to call it I get back a 500 and if I go to Monitor I see the 500 was a result of it not finding a module.当它部署到 Azure Function 并且我尝试调用它时,我得到一个 500,如果我用 go 来监控它,我看不到模块的 50 结果。 Initially this was oauth2client (I was using the classic editor to configure to job before I changed to YAML) and it is now throwing an error on numpy最初这是 oauth2client(在我更改为 YAML 之前,我使用经典编辑器来配置作业),现在它在 numpy 上引发错误

Failure Exception: ImportError: Unable to import required dependencies: numpy:失败异常:ImportError:无法导入所需的依赖项:numpy:

If I deploy from visual studio code it all works fine and as expected如果我从 Visual Studio 代码进行部署,一切正常且符合预期

I have utilised the call to我已经利用调用

https://.scm.azurewebsites.net/api/settings https://.scm.azurewebsites.net/api/settings

to get the underlining package that it is using, and I downloaded the package that is uploaded via VS Code and via the YAML and they have the same contents.为了得到它正在使用的下划线 package,我下载了通过 VS Code 和 YAML 上传的 package,它们具有相同的内容。

Not sure what is going wrong with this.不知道这是怎么回事。

Cheers Mark干杯马克

Starting with version 3.7, you are required to install the dependencies in .python_packages folder.从版本 3.7 开始,您需要在.python_packages文件夹中安装依赖项。

pip install --quiet --target="./.python_packages/lib/site-packages" -r./requirements.txt

https://docs.microsoft.com/en-us/azure/azure-functions/recover-python-functions?tabs=vscode https://docs.microsoft.com/en-us/azure/azure-functions/recover-python-functions?tabs=vscode

Since you are using vscode, you can also inspect the files when you open the Azure Extension and inspect the Files由于您使用的是 vscode,因此您还可以在打开 Azure 扩展程序并检查文件时检查Files

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Azure上部署Python Function App时出现KeyError - KeyError when deploying Python Function App on Azure 在Azure Devops中为基于Python的Azure Function设置发布管道的正确方法 - Proper way to set up a release pipeline in Azure Devops for Python based Azure Function 在 Azure Devops 中将参数传递给 python 脚本 - Passing arguments to python script in Azure Devops 在 Azure Devops 发布管道中启动 Python 看门狗 - Launching a Python watchdog in an Azure Devops Release pipeline Azure function 对于 python 无法访问 - Azure function for python is unreachable Azure DevOps - pip ValueError:HTML 文档类型丢失或不正确 - Azure DevOps - pip ValueError: HTML doctype missing or incorrect 使用 Azure Function 中的 Python 文件 - 只读文件系统 - Working with Python Files in Azure Function - Read Only File System 如何通过 azure-devops-python-api 获取仪表板列表 - How to get a list of dashboards through azure-devops-python-api 如何在 python 中使用 rest api 在 azure devops 中创建测试用例 - How to create test case in azure devops using rest api in python API 使用 python 调用 Azure DevOps 以获取组织中的用户列表 - API call using python to Azure DevOps to get list of users in an organization
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM