【问题标题】:How to remove the Request-Context header in an Azure Functions v2 response如何删除 Azure Functions v2 响应中的 Request-Context 标头
【发布时间】:2019-12-20 12:47:19
【问题描述】:

在 Azure Functions v2 应用中,客户端收到的标头中有:

Request-Context: appId=cid-v1:<UUID>

我了解此标头用于关联 Application Insights 中来自使用不同检测密钥的应用的请求,这不是我的情况。

是否可以删除 Request-Context 标头?

【问题讨论】:

    标签: azure-functions azure-application-insights


    【解决方案1】:

    可以通过 Application Insights 收集选项(在 host.json 中)

    {
      "version": "2.0",
      "logging": {
        "applicationInsights": {
          "httpAutoCollectionOptions": {
            "enableResponseHeaderInjection" : false
          }
        }
      }
    }
    

    【讨论】:

      【解决方案2】:

      【讨论】:

      • 谢谢@Kamran。请您详细说明如何在 Azure Functions 中应用该设置?在 Az Fun 中似乎无法通过 web.config 进行配置。
      猜你喜欢
      • 2018-07-07
      • 2020-06-18
      • 1970-01-01
      • 2011-12-15
      • 2018-07-09
      • 2018-06-11
      • 2012-06-24
      • 1970-01-01
      • 2017-12-09
      相关资源
      最近更新 更多