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
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/ip-collection.md
+25-19Lines changed: 25 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,11 +128,7 @@ Content-Length: 54
128
128
129
129
## Telemetry initializer
130
130
131
-
If you need a more flexible alternative than `DisableIpMasking`, you can use a [telemetry initializer](./api-filtering-sampling.md#addmodify-properties-itelemetryinitializer) to copy all or part of the IP address to a custom field.
132
-
133
-
# [.NET](#tab/net)
134
-
135
-
### ASP.NET or ASP.NET Core
131
+
If you need a more flexible alternative than `DisableIpMasking`, you can use a [telemetry initializer](./api-filtering-sampling.md#addmodify-properties-itelemetryinitializer) to copy all or part of the IP address to a custom field. The code for this class is the same across .NET versions.
136
132
137
133
```csharp
138
134
using Microsoft.ApplicationInsights.Channel;
@@ -160,11 +156,32 @@ namespace MyWebApp
160
156
> [!NOTE]
161
157
> If you can't access `ISupportProperties`, make sure you're running the latest stable release of the Application Insights SDK. `ISupportProperties` is intended for high cardinality values. `GlobalProperties` is more appropriate for low cardinality values like region name and environment name.
### Enable the telemetry initializer for ASP.NET Core
184
-
185
-
You can create your telemetry initializer the same way for ASP.NET Core as for ASP.NET. To enable the initializer, use the following example for reference:
0 commit comments