【Azure 应用程序见解】通过Azure Funciton的门户启用Application Insights后,Application Insights无法收到监控数据

问题描述

比较早期创建的Azure Funciton服务,近期发现在门户中已经启用了Application Insights功能,但是正确配置Applicaiton Insights后,却无法获取关联的Azure Function的监控数据?

 

问题分析

到目前为止,Azure Function已经经历了三个版本的发展,可以通过 FUNCTIONS_EXTENSION_VERSION 查看当前Azure Funciton的版本:

 

从官方的文档中,发现Application Insights已经在 Function V1.x, V2.x及V3.x的版本支持了。但是经过实测,V2.x, V3.x都能成功发送监控数据到Application Insights中而最早的V1.x版本却无法发送监控数据这与本文问题匹配。

最后经过咨询确认, 在中国区Function V1.X的集成除了要在门户中配置Applcation Insights外,还需要再Funciton的host.json中的applicationInsights一节修改endpoint并指向中国区的终结点:

Function host.json示例内容:

复制代码
{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[1.*, 2.0.0)"
  },
  "applicationInsights": {
    "ingestionEndpoint": "https://dc.applicationinsights.azure.cn/v2/track",
    "liveEndpoint": "https://live.applicationinsights.azure.cn/QuickPulseService.svc"
  }
}
复制代码

 

问题解决

1) Azure Function 页面中启用Application Insights

2) 修改Funciton的host.json文件,添加applicationInsights,ingestionEndpoint和liveEndpoint

 

 

参考资料

如何为 Azure Functions 配置监视: https://docs.azure.cn/zh-cn/azure-functions/configure-monitoring?tabs=v1

Azure Functions 运行时版本概述: https://docs.azure.cn/zh-cn/azure-functions/functions-versions

Application Insights Regions that require endpoint modification: https://docs.microsoft.com/en-us/azure/azure-monitor/app/custom-endpoints?tabs=net#regions-that-require-endpoint-modification

 

posted @   路边两盏灯  阅读(112)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示