We're using the Application Insights SDK (v2.14) in our .NET Framework 4.7.2 application and have been able to track SQL dependencies (albeit without query text) successfully.
We're now migrating to the Microsoft.Data.SqlClient package from System.Data.SqlClient so we can also do Advanced SQL tracking to see the full query text in our telemetry. We've updated the ApplicationInsights.config file to set EnableSqlCommandTextInstrumentation to true.
However, after installing the latest Microsoft.Data.SqlClient package (2.01 at the time of writing) we're no longer getting ANY SQL dependencies being tracked for code using the client.
What's the issue?
The issue is the combination of versions of the Application Insights SDK and Microsoft.Data.SqlClient.
Version 2.0 of Microsoft.Data.SqlClient changed the naming for EventSource tracing and in doing so effectively broke the support for SQL dependency tracking in the AI SDK for versions up to 2.15 (at the time of writing).
The workaround is to downgrade Microsoft.Data.SqlClient to version 1.1.3 which has the old EventSource naming. This will restore SQL dependency tracking (and show SQL Query text if you add the EnableSqlCommandTextInstrumentation flag).
There is are issues reported against the AI SDK to fix this (2032 in particular) that will hopefully mean this gets fixed in the future.
I hope this helps anyone who is pulling their hair out as much as I did :)