I need to inject a TelemetryProcessor into existing TelemetryConfiguration (Application Insights) to modify default Azure Function behavior.
There are examples how to do it through Dependency Injection for c# projects. I wonder whether there is a way to access it from C# script (csx).
It looks like it is possible to access through TelemetryConfiguration.Active
but compiler gives a warning that it is obsolete:
2021-04-17T01:38:35.988 [Warning] run.csx(28,15): warning CS0618: 'TelemetryConfiguration.Active' is obsolete: 'We do not recommend using TelemetryConfiguration.Active on .NET Core. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/1152 for more details'
I believe this might help here : https://github.com/microsoft/ApplicationInsights-dotnet/issues/1222#issuecomment-536034393
Internal team was working on the documentation too : https://github.com/microsoft/ApplicationInsights-dotnet/issues/1336
Re-posting the explanation here :