0

Azure app insights are not working after the application is being deployed to Azure App Service but it's totally looking good on the local.

I have added the Instrumentation key on ApplicationInsights.config file that's being provided by the Azure App Service on the local app and saw the requests are logging on the portal.

enter image description here

In some articles, it suggests that we should not keep some DLLs like

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

But seems like it's essential for the App insights. I am not sure where I am missing. Could anyone of you guide me on this?

Dinesh
  • 411
  • 6
  • 19
  • 1
    Did you enable app-insights on the app service itself through the portal? If you do it disables the app insights middleware in your code. – Vinez Jan 06 '22 at 13:34

1 Answers1

1

Here are few reasons and solutions that you can have a look why application insights aren't working after deployment.

SCENARIO - 1 Disabled Application insights on portal

Like @Vinez mentioned You can enable them from your appinsights overview page. Scroll down on the same page to see the left pane that shows an option of Application Insights and then “Turn On Application Insights”.

enter image description here

enter image description here


SCENARIO - 2 Missing AppInsights settings

You can navigate to Configuration -> Application settings and check if the appinsights settings (i.e.. APPINSIGHTS_INSTRUMENTATIONKEY, APPLICATIONINSIGHTS_CONNECTION_STRING, ApplicationInsightsAgent_EXTENSION_VERSION, XDT_MicrosoftApplicationInsights_Mode) have been added or not with appropriate values.

enter image description here

enter image description here


SCENARIO - 3 ApplicationInsights.Config not deployed with the application.

You can go to App Service Editor (preview) and check whether the AppInsights.config file is being deployed.

enter image description here

enter image description here

You can check this similar thread which deals with build and publish.


SCENARIO - 4 Due to restricted firewall.

Please try checking Enable Azure Application Insights on the VM-Series Firewall


Further you can log the traces and act accodingly using perfview.

REFERENCES :

  1. App Insights for web application not working when deployed to Dev server
  2. Troubleshooting no data - Application Insights for .NET.
SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18