【问题标题】:How do I determine what version of the Azure Function runtime I'm using locally?如何确定我在本地使用的 Azure Function 运行时版本?
【发布时间】:2020-06-06 04:53:35
【问题描述】:

我已经下载了 azure-functions-core-tool@3,当我使用 Azure 工具运行一个新创建的函数项目时,它似乎正在运行 v2,但我不确定。

settings.json 文件如下:

{
  "azureFunctions.deploySubpath": ".",
  "azureFunctions.postDeployTask": "npm install",
  "azureFunctions.projectLanguage": "JavaScript",
  "azureFunctions.projectRuntime": "~3",
  "debug.internalConsoleOptions": "neverOpen",
  "azureFunctions.preDeployTask": "npm prune"
}

但是,当我使用“npm start”或“func start”运行 Azure 函数时,标题部分会报告:

Azure Functions Core Tools (2.7.2184 Commit hash: 5afacc827c2848e4debc23bb96604f1ffce09cc7)
Function Runtime Version: 2.0.12961.0

后来在日志中我看到:

[warn] The Node.js version you are using (v12.17.0) is not fully supported by Azure Functions V2. We recommend using one the following major versions: 8, 10.

这似乎暗示这些功能仍在 2.0 模式下运行。

如何确定正在执行哪个版本的运行时?

【问题讨论】:

    标签: azure azure-functions azure-functions-runtime azure-functions-core-tools


    【解决方案1】:

    如果你看到

    函数运行时版本:2.0.12961.0

    您正在运行运行时 V2。

    运行 npm install -g azure-functions-core-tools@3 以显式安装 V3 运行时,您将在本地运行 V3。

    版本 2.x 和 3.x
    工具的 2.x/3.x 版本使用基于 .NET Core 构建的 Azure Functions 运行时。 .NET Core 支持的所有平台都支持此版本,包括 Windows、macOS 和 Linux。

    更多信息:Work with Azure Functions Core Tools

    【讨论】:

    • 我已经安装了几次 core-tools@3,它仍然运行 v2。
    • 显然我用 Chocolatey 安装了 v2 的副本,它覆盖了用 npm 安装的那个。
    猜你喜欢
    • 2023-02-01
    • 2022-12-05
    • 1970-01-01
    • 1970-01-01
    • 2019-02-11
    • 2022-10-15
    • 1970-01-01
    • 2020-01-01
    • 2022-11-11
    相关资源
    最近更新 更多