Visual Studio代码Azure函数错误,因为术语“func”无法识别为小工具、函数、脚本文件或可操作程序的名称

vtwuwzda  于 2023-11-21  发布在  其他
关注(0)|答案(1)|浏览(158)

我正在尝试在Visual Studio代码中使用Typescript创建Azure函数。当我运行代码时,它会抛出错误。
“术语'func'不能识别为小程序、函数、脚本文件或可操作程序的名称。请检查
名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试”。
我已经安装了npm,Azure工具。你能帮我吗?
我在本地用户访问下运行类型脚本azure函数。
谢谢

pbgvytdp

pbgvytdp1#

我已经在VS Code中用运行时堆栈Typescript创建了函数。下面的命令用于创建函数
使用以下命令浏览当前Azure函数核心工具并下载最新版本。

npm install -g azure-functions-core-tools@4 --unsafe-perm true

func init MyFunctionApp --typescript
cd MyFunctionApp
func new

字符串
我把http触发器功能。

host.json:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  }
}


通过使用func start命令成功执行函数。请检查以下内容:


的数据

相关问题