For some reason Application Insights is not tracking SQL queries executed by my Azure Function. I have the following packages installed:
- Function
Version 3
- Framework
netcoreapp3.1
I can see calls to blob storage and HTTP calls but SQL is out the mix.
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.17.0" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.17.0" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="1.1.3" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.10" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" />
Host.json
{
"version": "2.0",
"logging": {
"applicationInsights": {
"dependencyTrackingOptions": {
"enableSqlCommandTextInstrumentation": true
},
"samplingExcludedTypes": "Request",
"samplingSettings": {
"isEnabled": true
}
},
"logLevel": {
"default": "Information"
}
}
}
EDIT
Finally got this to work with host.json
settings added but its not grouping the telemetry data. What I mean is, the SQL calls are being tracked seperately independent from the request. Usally you get a nice view and all dependencies are tracked as a group but this is no longer the case.