【问题标题】:Add Application Insights Telemetry fails添加 Application Insights 遥测失败
【发布时间】:2021-10-27 20:19:38
【问题描述】:

我正在尝试将 Application Insights 添加到我的 WebApi 应用程序 (.net 4.6.2) 项目中。我转到菜单项目 > 添加 Application Insights Telemetry ... > 在 Azure 中选择我的 AppInsights 资源,然后它思考了很长时间并失败了。

这里有哪些失败的步骤,我该如何解决这个问题?

【问题讨论】:

  • @VovaBilyachat 这是一个类似但不同的错误。那个人的问题是安装了不同版本的软件包。我认为这里安装了可接受的版本,它只是无法在我的项目中进行自我配置。
  • @Brad 您是否为 Application Insights 添加了检测密钥(即 ApplicationInsights.config)?

标签: c# visual-studio azure-application-insights


【解决方案1】:
  • 在自动添加 Application Insights 时,我们需要在关闭 </ApplicationInsights> 标记文件之前将检测密钥添加到 ApplicationInsights.config
    <InstrumentationKey>"your-instrumentation-key-goes-here"</InstrumentationKey>
    
  • 然后通过导航到项目 > 管理 NuGet 包 > 更新,将每个Microsoft.ApplicationInsights NuGet 包更新到最新的稳定版本。。李>

如果自动添加 Application Insights 不起作用,您可以从 HERE 手动尝试。

参考: Configure monitoring for ASP.NET with Azure Application Insights - Azure Monitor | Microsoft Docs

【讨论】:

  • 我看到向导失败后,我留下了一个 ApplicationInsights.config 文件(由向导创建)。我可以在那里填写密钥,但是向导已经失败并且没有配置其余的设置(不清楚省略了多少)。我希望避免手动配置它,但这似乎是唯一的选择。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-09-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-10-29
  • 2016-08-12
相关资源
最近更新 更多