No Application Insights requests or exceptions showing for .NET 5 and 6 app services? Need to configure the project within Visual Studio

by Patrick Lee on 25 Aug 2022 in categories tech with tags Application Insights .NET 5.0 .NET6.0

I mentioned before that getting Applications Insights to work with a .NET 5 web app was a bit buggy (see https://pjlee.net/blog/application-insights-is-not-fully-supported-for-net-50-but-you-can-configure-it-manually).

Well although the link in the Azure portal to App Insights is not disabled for a .NET 6 web app, you can still find that despite everything appearing to be properly configured within the portal, no data (requests, traces, exceptions etc) appear in the App Insights logs.

As with my previous post on .NET 5, the solution seems to be to right click the project within Solution Explorer in Visual Studio and configure App Insights from there.

That adds code within the start up (in Program.cs for a .NET 6 web app) which seems to wake up whatever was asleep in Application Insights.