【问题标题】:Get ExecutionContext.InvocationId in startup (Azure function V2)启动时获取ExecutionContext.InvocationId(Azure函数V2)
【发布时间】:2020-02-12 13:44:01
【问题描述】:

目前我可以在函数方法中检索 ExecutionContext,如下所示:

public async Task <IActionResult> Run ([HttpTrigger (AuthorizationLevel.Anonymous, "post", Route = null)], ILogger log, ExecutionContext context)

有什么方法可以从我的函数启动中检索 ExecutionContext 吗?

【问题讨论】:

  • ExecutionContext 有多个参数,我建议澄清一下你在启动时究竟需要什么的问题。否则答案是否定的。

标签: c# visual-studio .net-core azure-functions


【解决方案1】:

很抱歉,您将无法在启动时获得ExecutionContext。因为 ExecutionContext 允许在进行函数调用时与 Azure Functions 执行环境进行交互。

但是,在您的函数启动中,您的 Azure 函数尚未处理实际的函数调用。

【讨论】:

    猜你喜欢
    • 2018-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多