从 Azure 函数中的 C# 脚本 (csx) 访问 TelemetryConfiguration 对象

问题描述

我需要将 TelemetryProcessor 注入现有的 TelemetryConfiguration (Application Insights) 以修改默认的 Azure Function 行为。

有一些示例如何通过依赖注入为 c# 项目做到这一点。我想知道是否有办法从 C# 脚本 (csx) 访问它。

看起来可以通过 TelemetryConfiguration.Active 访问,但编译器给出了它已过时的警告:

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'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)