SQL Server 和服务总线的 Azure Functions 依赖关系跟踪到 Application Insights

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

以前我有 Azure Web App (.net core),它成功地将 SQL Server 和服务总线依赖项跟踪到 Application Insights 中。它无法与 Azure Functions 一起使用。

环境

  • dotnet 6
  • dotnet 隔离模式
  • 日志级别默认设置为“信息”。
  • 使用 Azure Functions 消耗计划的 Azure 环境。
  • Application Insights key 已配置。

我的前端有 Azure API 管理,后端是 Azure Function,它调用 SQL Server 和服务总线。

  • Api 管理服务对 Azure 函数的依赖关系已成功解决,但 Azure 函数对其他组件的依赖性无法正常工作。

最佳答案

我知道我正在发布我自己的答案。此外,将来也有可能出现一些好的解决方案,或者以进程内模式的方式进行集成。

然后按照步骤操作。

  1. 添加包
Microsoft.ApplicationInsights.WorkerService
  • 在program.cs中配置主机。
  • services.AddApplicationInsightsTelemetryWorkerService();
    

    更多信息请访问 https://learn.microsoft.com/en-us/azure/azure-monitor/app/worker-service

    关于SQL Server 和服务总线的 Azure Functions 依赖关系跟踪到 Application Insights,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71997797/

    相关文章:

    node.js - 检查 botframework (node.js) 的 facebook 点赞情况

    azure - 运行在 PowerShell 中编码的 Azure Functions 时出现 Connect-AzAccount 错误

    azure - 通过多个Azure Application Insights查询日志

    azure - Azure Functions 中的默认 logLevel 阈值是多少?

    azure - 如何获取 App Insights 应用程序日志错误通知?

    python - Azure Spot 实例创建问题

    c# - 来自 C# 的 Azure BLOB 存储 REST 调用

    node.js - npm -g 在 Windows Azure 远程服务器上安装 weinre

    azure - 人们应该如何理解这个错误呢?

    Python 和 Snowflake 如何将 Azure AD 用户名和密码添加到 Snowflake 连接以便能够访问帐户并运行 ETL 脚本?