I am developing several ASP.NET web services that use SQL Server for storage and Azure Application Insights for telemetry. I was not getting full SQL command text in the dependency telemetry when running the services locally under IISExpress (although I did see stored procedure names when an SP was being called), so I followed the advice in the docs for this scenario, and migrated from System.Data.SqlClient to the new Microsoft.Data.SqlClient package.
Now I am not seeing any SQL dependency telemetry from any components that use Microsoft.Data.SqlClient. This is not the result I was hoping for.
Prior to the change, the sdkVersion in the dependency telemetry was "rddf:2.11.2-28447". The docs say I should see an "rddp:" prefix here, but since there is no longer any SQL telemetry, I don't have anything to check.
One service uses some code from Microsoft.AspNet.Identity.EntityFramework, which continues to use System.Data.SqlClient (not sure how to change that). SQL dependency telemetry is still being generated for these classes, but of course does not include the full command text, and still has the "rddf:" SDK version prefix.
What do I need to do to get SQL dependency telemetry that includes the full command text?
Some details:
- .NET Framework 4.7.2
- Microsoft.ApplicationInsights.Web 2.11.2
- Microsoft.ApplicationInsights.DependencyCollector 2.11.2
- Microsoft.Data.SqlClient 1.0.19269.1. Newer versions (1.1.x) require an update to Microsoft.IdentityModel.JsonWebTokens that I cannot take at this time.