Application Insights 在部署到 Azure 应用服务后停止工作

Application Insights stops working after deployment to Azure App Service

我的团队有一个部署到 Azure 应用服务的 .NET MVC 4.6 应用程序。我们正在使用 Agent-based application monitoring 实施,因此,我们在 App Server 级别打开 Application Insights,它应该可以正常工作。

每次我们将应用程序部署到 Azure(使用 Azure DevOps); Application Insights 同时显示仍处于启用状态;不再有效。

让 Application Insights 重新工作的唯一方法是禁用它;等待几秒钟并重新启用它。然后 Live Metrics 启动,一切正常。

这发生在我们的开发、质量保证和生产环境中。我们显然遗漏了一些东西,但不确定要寻找什么。我们有 Azure 为我们提供的以下配置设置:

我已经验证检测密钥是正确的。

位于 https://docs.microsoft.com/en-us/azure/azure-monitor/app/status-monitor-v2-troubleshoot 的 App Insights Agent 故障排除文档指出以下程序集的存在可能会导致与 App Insights Agent 发生冲突:

  • Microsoft.ApplicationInsights.dll
  • Microsoft.AspNet.TelemetryCorrelation.dll
  • System.Diagnostics.DiagnosticSource.dll