CodePudding user response:
- By default, SQL Collection is set to off. We need to enable it in the Azure Portal.
- To get the full SQL Query, we need to enable the
SQL Commandsin our deployedApp Service=>Application Insights.

- Add the below line of code in
Program.csfile, if it is.NET CoreApplications.
builder.Services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => { module.EnableSqlCommandTextInstrumentation = true; });
- If it is
.NET FrameworkApplication, add the below line inTelemetryModulessection inApplicationInsights.configfile (which is generated when we add Application Insights in Visual Studio.
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector">,
<EnableSqlCommandTextInstrumentation>true</EnableSqlCommandTextInstrumentation>
</Add>

