Found the issue. The direct cause is missing sections in web.configweb.config
.
ApplicationInsightsHttpModuleApplicationInsights
HttpModule
is for capturing requests information in App Insights.
myAppInsightsListenermyAppInsightsListener
in system.diagnosticssystem.diagnostics
is for capturing the traces.
The problem that caused this complicated and long process of troubleshooting is that when we thought it's exactly the same code works in UAT but not others, it's actually not UAT that's pushing data, it's actually one of UAT's slot that's pushing data which had a different web.configweb.config
that contains those missing sections. In the end, it's the logging of UAT doesn't match the time of some schedule tasks defined time made me thinking if that's from the correct UAT environment.
Sitecore support provided help however only ApplicationInsightsHttpModuleApplicationInsights
HttpModule
was mentioned so it didn't resolve the issue when it was tested.
This could have been easy, lesson learned is that should have compared the web.config with Sitecore official package from the beginning. That would have saved all those effort.