Search code examples
.netazureazure-application-insights

Application Insight is not showing any data after deployment of ASP.Net Desktop application on server


I am trying to enable Code-based monitoring with application insights to my existing ASP.Net desktop application, I have performed the below steps :

  1. Selected Project > Add Application Insights Telemetry > Application Insights Sdk (local) > Next > Finish > Close. (Installed Application Insights NuGet packages)

  2. Opened the ApplicationInsights.config file. and added the InstrumentationKey Before the closing in the config file

  3. Selected Project > Manage NuGet Packages > Updates. Then updated each Microsoft.ApplicationInsights NuGet package to the latest stable release.

  4. Also, Installed Microsoft.ApplicationInsights.NLogTarget NuGet package.

When I am running the application locally in debug mode it's sending all the relevant data and exceptions logs to the Application Insight portal. But when I deploy the same, it does not send any data or exception logs to Application Insight portal.

What could possibly cause this issue and how this can be fixed?

Note: On the same deployment server where above code based implementation is not working, I Installed application insight agent and enabled monitoring using powershell scripts. And that works fine and send data to application insight portal.

Can anyone guide me how can I get the first approach(code-based) working after deployment ?

Thanks in advance !


Solution

  • I hope you are already updated the related Application Insights packages. Check the below possibilities to fix no data shared to Application Insights

    1. Please make sure in your deployed project contains the below DLL's.
    • Microsoft.ApplicationInsights.dll
    • Microsoft.AspNet.TelemetryCorrelation.dll
    • System.Diagnostics.DiagnosticSource.dll
    • Microsoft.Diagnostics.Instrumentation.Extensions.Intercept.dll
    1. Make sure to check ApplicationInsights.config file is available in your deployed project. It was Build/Deploy project.
    2. In your firewall, you might have to open 443 TCP Port. You can check the data whether we can receive or get by using Fiddler and Perfview. Refer IP address used by azure monitor
    3. Make sure you have all Application insights SDK binaries in your deployed project.
    4. In contrast to local debug web.config, web.config on the server (a.k.a. "Release") is slightly different and does not have AI Module specified.
    5. Set defaultProxy in Web.config if you need to utilise a proxy to transport data outside your business network.

    References