且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Azure 函数结构

更新时间:2023-02-03 17:07:38

一个问题是 Visual Studio 有一个过时的 Functions Core 工具版本.在此问题得到解决之前,您可以通过以下方式解决:

One issue is that Visual Studio has an outdated version of the Functions Core tools. Until this is resolved, you can work around in the following way:

  • 通过运行 npm install -g azure-functions-core-tools
  • 通过 npm 安装最新版本
  • 在 VS 中的 Function App 中,转到属性"
  • 转到调试",然后单击配置文件"下的新建..."
  • 将新配置文件命名为 FunctionsNpm 之类的名称
  • 将可执行文件设置为(替换 [YourUserName]):C:Users[YourUserName]AppDataRoaming pm ode_modulesazure-functions-core-toolsinfunc.exe
  • 将参数设置为 host start
  • 设置工作目录为$(TargetDir)
  • 在工具栏中,查找绿色三角形图标,将您当前的个人资料更改为您刚刚创建的个人资料:
  • Install the latest via npm by running npm install -g azure-functions-core-tools
  • In your Function App in VS, go to the Properties
  • Go to Debug, and click New... under Profile
  • Name the new Profile something like FunctionsNpm
  • Set the executable to (replace [YourUserName]): C:Users[YourUserName]AppDataRoaming pm ode_modulesazure-functions-core-toolsinfunc.exe
  • Set the arguments to host start
  • Set the working directory to $(TargetDir)
  • In toolbar, look for the green triangle icon to change your current Profile to the one you just created:

现在,当您从 VS 运行时,您将使用 npm 工具,而不是 VS 包附带的旧工具.

Now when you run from VS, you'll be using the npm tools instead of the older one that come with the VS package.