You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In terms of unit tests the code that is using injected telemetry client through the method AddApplicationInsightsTelemetry() how can we mock telemetry client? What would be recommended best practice?
Thanks.
Hi,
Microsoft has changed how
TelemetryInitializers
have to be added:Old way:
TelemetryConfiguration.Active.TelemetryInitializers.Add(new MyTelemetryInitializer());
New way:
services.AddSingleton<ITelemetryInitializer>(new RoleNameInitializer("my-service-name"));
Source: microsoft/ApplicationInsights-dotnet#1152
It would be great if you could update the article (https://vincentlauzon.com/2019/01/23/azure-application-insights-role-name-nuget-package/) with the new info.
The text was updated successfully, but these errors were encountered: