visual-studio - Azure Function App = 在本地运行单个 Azure Function 进行调试

标签 visual-studio azure azure-functions faas

在 Visual Studio 中,我创建了一个具有多个函数的 Azure 函数应用程序。

当我从工具栏启动 Function App 调试器时,所有函数都会被触发。

有没有办法在 Visual Studio 2017 中从应用程序触发单个函数?

最佳答案

实现这一目标并不容易,但这是可能的。

  1. Disable functions:

通过修改function.json文件:

"bindings": [
...
],
"disabled": true

或使用 [Disable] 属性:

[Disable]
[FunctionName("Function")]
[NoAutomaticTrigger]
public static void Function(string input, TraceWriter log)
{ }
  • func run using Azure Core Tools (only v1.x)
  • 使用命令运行函数:func run <functionName>

  • Specify functions in the host.json file
  • 在您的 host.json 文件中指定应运行的函数:

    { 
       "functions":[ "FunctionToRun" ]
    } 
    

    关于visual-studio - Azure Function App = 在本地运行单个 Azure Function 进行调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52836451/

    相关文章:

    asp.net - Windows Azure PaaS(Web 角色)的真正替代品?

    python - pydocumentdb CosmosDb Python - 如何向同一文档添加多个条目

    c# - Azure Functions - C# - 运行外部应用程序?

    azure - 在特定子域上实现 Azure WAF IP 限制

    azure - 在使用javascript的azure函数中如何调用向端点发送请求

    Azure Functions 和本地 TCP 服务器

    visual-studio - Docker 镜像在 Windows/MVC 核心上构建的速度很慢

    c# - 如何在 Visual Studio IDE 中使所有 IDisposable 类的颜色不同?

    c++ - 从 VS2003 到 VS2005 的转换问题?

    c# - 如何为具有前导描述的应用程序元素实现 "Go To Definition"?