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:
It cannot include the full sql command text if you're using Microsoft.Data.SqlClient 1.0.19269.1. There is an issue about that.
In my .net 4.7.2 web project, I'm using Microsoft.Data.SqlClient 1.1.0. The full sql command text can be included. The screenshot as below:
Other nuget packages I'm using:
Microsoft.ApplicationInsights.Web 2.11.0
Microsoft.ApplicationInsights.DependencyCollector 2.11.0
Microsoft.ApplicationInsights 2.14.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With