Closed HarshitS00D closed 6 months ago
host.json
settings do not apply to the worker process: only to the host process. You will need to configure SQL dependency tracking yourself via services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => { /* configure */);
Adding comment to keep this alive, I'll verify with the above mentioned info and will update here after.
host.json
settings do not apply to the worker process: only to the host process. You will need to configure SQL dependency tracking yourself viaservices.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => { /* configure */);
You just blew my mind. While in hindsight this makes complete sense, I do not remember mentioned anywhere in documentation that host and worker process need to be configured separately for logging. If it exists and I just missed it, can you please provide a link?
Issue resolved from recommended solution as above, hence closing this issue. Thank you for the support.
Description
We are running Isolated Azure Function in .NET 8 and we have followed the steps mentioned in the documentation to configure application insights properly but, we are not able to track the SQL queries inside Application Insights.
We have gone through the similar issue reported https://github.com/Azure/azure-functions-dotnet-worker/issues/822 and have tried the workaround as well https://github.com/Azure/azure-functions-dotnet-worker/issues/822#issuecomment-1088012705 but it didn't help. I have attached our program.cs, host.json and .csproj file in the steps to reproduce.
Steps to reproduce
.csproj
host.json
program.cs