以前我有 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 函数对其他组件的依赖性无法正常工作。
最佳答案
我知道我正在发布我自己的答案。此外,将来也有可能出现一些好的解决方案,或者以进程内模式的方式进行集成。
然后按照步骤操作。
- 添加包
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/