Home Ask Login Register

Developers Planet

Your answer is one click away!

Chesheersky February 2016

How can I hide Client IP address in Application Insights?

I've tried to add the following TelemetryInitializer:

TelemetryConfiguration.Active.TelemetryInitializers.Add(new HiddenIpsTelemetryInitializer());

public class HiddenIpsTelemetryInitializer : ITelemetryInitializer
    public void Initialize(ITelemetry telemetry)
        telemetry.Context.Properties["Client IP address"] = "Hidden";

But it doesn't do what I want. It adds a new property to "Custom Data" section, and what I want is to hide the "Client IP address" in "Request Properties" section.


John Gardner February 2016

you need to change the value of telemetry.Context.Ip instead of what you are doing. anything inside properties named like that would be submitting new custom properties.

to see how AI collects it in the core .net sdk, see: LocationContext.cs in the core sdk on github

Post Status

Asked in February 2016
Viewed 3,573 times
Voted 9
Answered 1 times


Leave an answer

Quote of the day: live life