Azure Application Insights not tracking SQL Queries

Viewed 1915

We can no longer see the actual SQL queries being executed in Application Insights after we had upgraded our web apps to .Net Core 3.1. We left the EF Core at version 2.2 due to some serious performance issues with EF Core 3.x, so not sure if that has anything to do with that? All we see now is just the target DB details:

enter image description here

Prior to that we were on AspNetCore 2.2 with EF Core 2.2 and everything was working fine, Application Insights was showing us the actual SQL statements being executed.

We've tried the suggestions form Microsoft here, which suggested to add the Microsoft.Data.SqlClient nuget package to the project, but that did absolutely nothing.

We've also tried turning on the "Application Insights -> Sql Commands" option in our App Service, but that did nothing either.

enter image description here

Does anyone have any suggestions on how to get this working again?

Thanks

EDIT:

Nuget packages we are referencing:

enter image description here

2 Answers

It seems that it's an issue about the latest version of Microsoft.ApplicationInsights.AspNetCore 2.14.0. I can repro the issue in 2.14.0, but it works when I downgrade it to 2.12.0.

The test result with using Microsoft.ApplicationInsights.AspNetCore 2.12.0:

enter image description here

Related