According to the documentation you need to add the following to your applicationInsights.config
file to enable full SQL logging:
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector">
<EnableSqlCommandTextInstrumentation>true</EnableSqlCommandTextInstrumentation>
</Add>
But in my ASP.NET app running on .NET Framework 4.7.2 hosted in an Azure App Service I'm enabling/configuring Application Insights via code:
TelemetryConfiguration.Active.DisableTelemetry = false;
TelemetryConfiguration.Active.InstrumentationKey = setting.ApplicationInsightsInstrumentationKey;
How can I enable this setting via code?
P.S.: The settings in the Web App are correctly enabled.