I am trying to log CustomEvents in Application insight using telemetry . The code is a C# Console application and using below code to log Custom Event in Application Insight.
TelemetryConfiguration configuration = TelemetryConfiguration.CreateDefault();
configuration.InstrumentationKey = "*************";
var telemetryClient = new TelemetryClient(configuration);
var properties = new Dictionary<string, string> { { "testKey1", "testVal1" }, { "testKey2", "testVal2" } };
telemetryClient.TrackEvent(EventName, properties);
telemetryClient.Flush();
This code is working fine in Visual Studio 2022 and also logging values in App Insight . But in VS Code it is not pushing any data in App Insight. I am not even getting and error messages in VS Code. Please suggest.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.