David Gourde
David Gourde

Reputation: 3914

Show Operation Name on Application Insights with URLs in lowercase for dotnet core 3.1 application

Right now, Application Insights shows the Operation Name including the casing, so if clients use different casing, I end up with multiple entries, like so:

POST /api/v1/myapi
POST /api/v1/myApi // Capital "A" in Api

I want all of them to appear under the lowercase Operation Name.

My app is a REST dotnet core 3.1 Api without Mvc.

I tried adding services.AddRouting(options => options.LowercaseUrls = true);, but this changed nothing.

Upvotes: 1

Views: 1120

Answers (1)

ZakiMa
ZakiMa

Reputation: 6241

One way is to use ITelemetryInitializer and lowercase Operation Name there.

Upvotes: 2

Related Questions