Reputation: 1625
How to add custom field in application insights request through Policy (under API Management api policy).
we have created api under api management and would like to update the application insights request to include custom field within INBOUND POLICY of Api.
public class CustomTelemetry : ITelemetryInitializer
{
public void Initialize(ITelemetry telemetry)
{
var requestTelemetry = telemetry as RequestTelemetry;
if (requestTelemetry == null) return;
requestTelemetry.Properties.Add("LoggedInUserName", "DummyUser");
}
}
Upvotes: 1
Views: 370
Reputation: 7810
This is not possible at the moment, but similar functionality will be included in coming updates.
Upvotes: 2