Search code examples
azureazure-application-insights

Application Insights stops working after deployment to Azure App Service


My team has a .NET MVC 4.6 application we deploy to Azure App Services. We are using the Agent-based application monitoring implementation, thus, we turn on Application Insights at the App Server level and it should just work.

Every time we deploy the application to Azure (using Azure DevOps); Application Insights while showing still enabled; no longer works.

  • Clicking on Live Metrics gives the screen saying the app is offline (although its very much online and accessible)
  • If you click on performance or bugs, there is no data

The only way to get Application Insights to work again is to Disable it; wait a few seconds and Re-Enable it. Then Live Metrics fires up and everything works fine.

This happens in our Dev, QA and Production environment. We are clearly missing something but unsure what to look for. We have the following configuration settings that Azure put there for us:

  • APPINSIGHTS_INSTRUMENTATIONKEY
  • APPINSIGHTS_PROFILERFEATURE_VERSION
  • APPINSIGHTS_SNAPSHOTFEATURE_VERSION
  • APPLICATIONINSIGHTS_CONNECTION_STRING
  • ApplicationInsightsAgent_EXTENSION_VERSION

I have validated the Instrumentation Key is correct.


Solution

  • The troubleshooting documentation for App Insights Agent at https://learn.microsoft.com/en-us/azure/azure-monitor/app/status-monitor-v2-troubleshoot points out that the existence of the following assemblies could cause conflicts with App Insights Agent:

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