azure-functions - AddApplicationInsightsTelemetry 在 Azure 函数中无法识别

标签 azure-functions azure-application-insights .net-6.0 telemetry

我正在开发 .NET CORE 6 <TargetFramework>net6.0</TargetFramework> Azure 函数应用程序。我已经安装了以下库

<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.20.0" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />

我正在尝试注册AddApplicationInsightsTelemetry()但它没有被识别,不确定我在这里错过了什么?

Startup class

using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

[assembly: FunctionsStartup(typeof(abc.IS.ProcessingFunction.Startup))]
namespace abc.IS.ProcessingFunction
{
   public class Startup : FunctionsStartup
   {
     public override void Configure(IFunctionsHostBuilder builder)
     {
         builder.Services.AddApplicationInsightsTelemetry();
     }
   }
}

enter image description here

最佳答案

我已成功使用注册服务

 builder.Services.AddApplicationInsightsTelemetryWorkerService();

关于azure-functions - AddApplicationInsightsTelemetry 在 Azure 函数中无法识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72514694/

相关文章:

c# - 将列表分成 3 部分以加速异步功能

azure - 具有 Microsoft 身份平台身份验证的 Web API

c# - Azure函数: limit the number of calls per second

node.js - 如何依赖 Oauth2 身份验证流程对 Azure 应用程序进行性能/ping 测试?

azure - 在本地运行timerTrigger函数返回 "Error calling the functions host: Unauthorized"

json - 使用流分析将自定义事件维度从 Application Insights 导出到 SQL

c# - Application Insight 中的范围日志记录

c# - 抛出 NullReferenceException 但对象通过了 null 检查,这怎么可能?

python - 在 Azure Functions 中安装requirements.txt 时无法解析对 numpy 的依赖关系

azure - 存储队列连接字符串环境变量