python - 无法从 az cli 部署 python 应用程序

标签 python azure ubuntu azure-web-app-service azure-cli

我们在使用 Az CLI 将 python 应用程序部署到应用服务时遇到问题。你知道问题的根源吗?
这是我们使用的命令。我们在 ubuntu VM 上执行它。az webapp up -n $WEB_APP_NAME -l "westeurope" -g $RESOURCE_GROUP_NAME --sku B1这是我们遇到的错误。我们不明白:

Zip deployment failed. {'id': '200a84e1e024461ca2ef18edd8c3f607', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2021-06-22T15:49:57.8395052Z', 'start_time': '2021-06-22T15:49:59.5399261Z', 'end_time': '2021-06-22T15:50:13.4118115Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'test-surveillance-api-2'}. Please run the command az webapp log deployment show -n test-surveillance-api-2 -g azr-rg-bpceit-bpcesa-d2i2`
这是 full deployment log 的链接.在这些日志中,我看到了以下错误。他们不清楚哈哈。
knack.util.CLIError: Zip deployment failed. {'id': '273909f740bd44de93111b0576d235f9', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2021-06-22T16:11:12.3912894Z', 'start_time': '2021-06-22T16:11:13.5603203Z', 'end_time': '2021-06-22T16:11:23.3248561Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'test-surveillance-api-2'}. Please run the command az webapp log deployment show -n test-surveillance-api-2 -g azr-rg-bpceit-bpcesa-d2i2
cli.azure.cli.core.azclierror : Zip deployment failed. {'id': '273909f740bd44de93111b0576d235f9', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2021-06-22T16:11:12.3912894Z', 'start_time': '2021-06-22T16:11:13.5603203Z', 'end_time': '2021-06-22T16:11:23.3248561Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'test-surveillance-api-2'}. Please run the command az webapp log deployment show -n test-surveillance-api-2 -g azr-rg-bpceit-bpcesa-d2i2
Zip deployment failed. {'id': '273909f740bd44de93111b0576d235f9', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2021-06-22T16:11:12.3912894Z', 'start_time': '2021-06-22T16:11:13.5603203Z', 'end_time': '2021-06-22T16:11:23.3248561Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'test-surveillance-api-2'}. Please run the command az webapp log deployment show -n test-surveillance-api-2 -g azr-rg-bpceit-bpcesa-d2i2
更多环境详情:
操作系统:Ubuntu 18.04.5 LTS
Python版本:3.8.7

最佳答案

我解决了我的问题!
在做了一些研究之后,我注意到问题出在 requirements.txt 和包含我的文件的存储库上。
因此,我将文件复制到另一个存储库中。我用我的python虚拟环境(./env/bin/python3)的python生成了requirements.txt,而不是安装在操作系统中的那个。
我不明白为什么这是问题所在。如果有人知道,请告诉我。
祝你有美好的一天。

关于python - 无法从 az cli 部署 python 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68097277/

相关文章:

ubuntu - insmod 无法插入一个非常简单的模块

python - 将制表符分隔的 csv 读入具有不同数据类型的 numpy 数组

python - 嵌套列表上的 Itertools 链

azure - 无法部署 Azure Function App - 存储帐户错误

azure - 将gas Limit参数更改为azure私有(private)区 block 链上的genesis.json文件

Bash - 我的脚本不记得变量

python - 将键/值对列表(或其他迭代器)添加到字典的 Pythonic 方法是什么?

python - Django "detail": "Method\"GET\"not allowed." (one to many relationship)

Azure WebJob 多个可执行文件

linux - 安装 Docker Ubuntu 16.04 -- 找不到包