azure-functions - 创建 azure 函数应用程序后如何更改运行时堆栈

标签 azure-functions

一旦创建了 azure 函数应用程序,我们有什么方法可以将 azure 函数应用程序中的运行时堆栈从 .net 更改为 python。

最佳答案

根据一些测试,我发现如果操作系统是linux,它可以从.net改为python。如果.net函数用linux系统运行,我们可以通过点击“Configuration”-->edie“FUNCTIONS_WORKER_RUNTIME”将runtime stack改为python并保存。之后,当我们将VS code中的python部署到azure中,函数就可以运行成功了。 enter image description here enter image description here

但是如果.net function app是在window系统下,虽然我们可以通过上面的步骤编辑runtime stack。但是当我们将函数从 VS code 部署到 azure 时,它​​会显示错误消息“Publishing Python functions is only supported for Linux FunctionApps”

顺便说一下,如果你想在 python 中创建一个函数应用程序,azure 只允许 linux 作为其操作系统,而 .net 中的函数应用程序可以选择其操作系统的 windows 和 linux。

关于您的另一个问题,我们可以在哪里看到现有的函数应用程序运行时堆栈。引用上面的步骤,我们可以在函数应用的“配置”中看到运行时堆栈。

更新:

关于如何知道你现有的函数应用程序正在使用的操作系统的问题,我检查了我身边的函数应用程序,但没有找到可以直接知道操作系统的地方。但我们可以通过其他方式了解它。

  1. 如果我们创建一个window系统的function app,点击“Configuration”按钮后可以找到“General settings”选项卡,但是“General settings”不会出现在linux系统的function app中。 (如下两张截图所示) enter image description here enter image description here

  2. 另一方面,我们可以通过函数的导出模板了解操作系统。请点击“平台功能”-->“导出模板”按钮。 enter image description here enter image description here enter image description here

如果函数是linux系统,“kind”属性(在“resources”属性下)将显示为“functionapp,linux”。如果函数是 windows 系统,"kind"属性将只显示 "functionapp"

希望对你有帮助~

关于azure-functions - 创建 azure 函数应用程序后如何更改运行时堆栈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59841128/

相关文章:

node.js - Azure Function 到 blob 存储,指定文件名和元数据

azure - 为基于消耗的 Azure Functions 创建的应用程序服务计划是否可重复使用?

Azure函数: Add environment specific config variable file in VS 2017 Preview 4

node.js - Azure Function 如何根据命令启动更大的 Node.js 应用程序

c# - 从逻辑应用调用 Azurefunction 会抛出 "Runtime keys are stored on blob storage. This API doesn' t 支持此配置。”

azure - 如何锁定 Azure 存储表中的项目以一次仅允许一个 Azure 函数访问其数据

azure - 通过将新行插入(添加)到 SQL Server 数据库表中来触发 Azure Function

azure - 每当将 blob 添加到容器中时,将数据从 blob 存储发送到 cosmosDB 时,azure app-function 的绑定(bind)类型会出现问题

在 Terraform 中使用 azurerm_runction_app_function 时,Azure 函数 Url 不包含身份验证代码

java - 记录 Azure 函数