首页 > 解决方案 > 将 Azure Functions 部署到 Azure 时出现 bcrypt 错误

问题描述

我开发了一个 Azure 函数,它使用 Python 3.6.8 将数据从 SFTP 摄取到 Azure SQL 数据库/数据仓库。该代码内置于 VS 代码中,并且在我的机器上本地运行良好。当我尝试部署到功能应用程序时,出现以下错误 -

恢复依赖项时出错。错误:无法安装 bcrypt-3.1.6 依赖项:不支持没有轮子的二进制依赖项。使用 Docker 容器使用 --build-ne 依赖项。更多信息,请访问https://aka.ms/func-python-publish

这是日志:

pip download --no-deps --only-binary :all: --platform manylinux1_x86_64 --python-version 36 --implementation cp --abi cp36m --dest ..\AppData\Local
pip download --no-deps --only-binary :all: --platform manylinux1_x86_64 --python-version 36 --implementation cp --abi cp36m --dest ..\AppData\Local
pip download --no-deps --only-binary :all: --platform manylinux1_x86_64 --python-version 36 --implementation cp --abi cp36m --dest ..AppData\Local
pip download --no-deps --only-binary :all: --platform manylinux1_x86_64 --python-version 36 --implementation cp --abi cp36m --dest ..AppData\Local
pip wheel --no-deps --no-binary :all: --wheel-dir ..AppData\Local\Temp\azureworker20z8e3i6 bcrypt==3.1.6

There was an error restoring dependencies. ERROR: cannot install bcrypt-3.1.6 dependency: binary dependencies without wheels are not supported.  Use the --build-ne dependencies using a Docker container. More information at https://aka.ms/func-python-publish

标签: python-3.xazure-functions

解决方案


我能够通过在本地机器上安装 docker 并使用 CLI 命令构建和部署到 azure function app 来解决这个问题 -

func azure functionapp 发布 --build-native-deps


推荐阅读