【问题标题】:Unable to get functionapp create to work with Python on Azure无法让 functionapp create 与 Azure 上的 Python 一起使用
【发布时间】:2021-09-01 06:11:19
【问题描述】:

尝试使用https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-python?tabs=azure-cli%2Cbash%2Cbrowser#create-supporting-azure-resources-for-your-function 上的教程部署 Azure 函数,但我无法通过 functionapp create 创建 Python 函数应用。我正在使用 Python 3.7.8,该函数的名称是挑战,我计划部署到 Azure,在那里我已经有一个运行的站点主要是 C#。我在命令行中这样调用它:

az functionapp create --consumption-plan-location westus --runtime python --runtime-version 3.7 --functions-version 3 --name challenge --os-type windows

我得到这个错误:

usage error: Currently supported runtimes (--runtime) in windows function apps are: dotnet-isolated, dotnet, node, custom, java, powershell.

根据az function app create 文档python 应该可以工作。

我绝望地尝试了这个:

az functionapp create --consumption-plan-location westus --runtime dotnet --functions-version 3 --name challenge --os-type windows

这产生了错误消息Operation returned an invalid status 'Conflict'

如何在 Azure 上部署 Python 函数应用?

【问题讨论】:

    标签: python azure-functions


    【解决方案1】:

    仅支持使用基于 linux 的运行时(see note on Python Functions developer referenceand available system/runtime combinations

    您可能希望考虑使用仅 linux-code 的函数,或者将您的代码部署为 linux docker 容器。

    【讨论】:

    • linux 不工作!我尝试了az functionapp create --consumption-plan-location westeurope --runtime python --runtime-version 3.7 --functions-version 3 --name challenge --os-type linux之类的东西,但仍然收到错误消息Operation returned an invalid status 'Conflict'
    • 尝试添加--debug 选项以获得更详细的输出?
    猜你喜欢
    • 2017-02-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-09
    • 2013-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多