Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to see the SQL commands in App Insights executed by QA environment of API app?

We developed API Application and published it into Azure using DevOps with two environments like Dev and QA.

In Dev environment we are able to see SQL queries executed by APIs, but in QA environment we are unable to see the SQL queries executed by the APIs.

In Dev environment we see the following in App Insights

Dependency Properties: SQL Command

SELECT TOP (1) [c].[CreatedOn] AS [CreatedOn] FROM [dbo].[__MigrationHistory] AS [c]

For the same call in QA environment the command property is not showing SQL query instead we are seeing the following in the command

Command

tcp:qasqldb01.database.windows.net,1433 | DB_QA

Can you please tell me where did I mistaken and is there any extra configuration needed for QA environment to see the SQL call command?

like image 328
Pradeep Avatar asked Sep 20 '25 05:09

Pradeep


1 Answers

In the documentation is:

For ASP.NET Core applications, It is now required to opt-in to SQL Text collection by using

services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => { module.EnableSqlCommandTextInstrumentation = true; });

like image 101
Michal Zemek Avatar answered Sep 22 '25 08:09

Michal Zemek