【Azure Application Insights】公网白名单应用如何使用 Application Insights 可用性测试?

问题描述

应用部署在 Azure VM 中并通过公网入口提供服务,同时仅允许指定 IP 访问。配置 Application Insights 标准可用性测试后,探测可能持续失败。

原因是探测请求来自 Microsoft 托管探测点,而不是已知的IP地址段,发起Application Insights Availability test的相关请求来源未被纳入访问此应用的入口白名单中。

那么,问题的关键点,是如何才能获取到Application Insights Availability服务的IP地址段呢?

问题解答

Application Insights Availability Test的配置页面:

Application Insights Availability Test 适用于可从公共互联网访问、且可被公共 DNS 解析的 HTTP/HTTPS 终结点。根据 Azure Monitor 网络访问与防火墙配置文档,为覆盖所需的网络例外,应在 Azure NSG 或 Azure Firewall 的入站规则中放行**ActionGroup、ApplicationInsightsAvailability 和 AzureMonitor**服务标记,并仅开放应用实际需要的端口(通常为 TCP 443)。

在 Azure 中国云中,ActionGroup 和 ApplicationInsightsAvailability 可能出现在官方 Azure IP Ranges and Service Tags JSON 文件中,但尚不能作为 NSG 或防火墙规则可引用的服务标记(JSON 中的 networkFeatures 为 null)。

(文档链接:Download Azure IP Ranges and Service Tags -- China Cloud from Official Microsoft Download Center)

因此,需要从该 JSON 文件提取两个服务的 addressPrefixes,将对应公网 CIDR 手动加入 VM 公网入口的白名单,AzureMonitor 则按当前环境中可用的服务标记配置,所以不需要再次手动添加Azure Monitor服务的IP地址段。

注:IP 地址范围会更新,应定期同步 JSON 文件并自动化更新规则,不能将一次导出的列表视为永久配置。

参考资料

Application Insights availability tests : https://learn.microsoft.com/azure/azure-monitor/app/availability

Azure Monitor endpoint access and firewall configuration : Azure Monitor endpoint access and firewall configuration - Azure Monitor | Microsoft Learn

Service tags overview : Azure service tags overview | Microsoft Learn

Use availability tests on an internal server behind a firewall : https://learn.microsoft.com/troubleshoot/azure/azure-monitor/app-insights/availability/internal-server-availability-tests-firewall

当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

相关推荐
昔我往昔2 天前
Blueprint和route的区别
flask
专业程序开发源3 天前
flask动漫推荐系统32319-计算机课程设计、毕业设计
java·spring boot·后端·django·flask·php·课程设计
国科安芯3 天前
ASC0101S(1 位自动方向双向电平转换器)在星载 I²C / 1-Wire 双向数据总线中的应用研究
可用性测试·电平转换·抗辐射·在轨服务
HwJack203 天前
【共创稿事节】HarmonyOS 7空间应用的可用性测试和体验评估小方法分享
华为·harmonyos·可用性测试
ysu_03144 天前
Postman接口调试实战指南-从HTTP请求到环境变量-Collection与自动化测试
网络·网络协议·测试工具·http·api·postman·可用性测试
qq_2518364574 天前
理发管理系统 —— 会员模块
开发语言·前端·python·flask
昔我往昔4 天前
init文件介绍
python·flask
阿钱真强道5 天前
25 嵌入式操作系统 | 设备面板:用 Qt 控件把“设备“画出来(本节不接串口)
开发语言·qt·flask·架构设计·协议契约
程序员无隅5 天前
Agent 评测与调优:从 Trace 检查到反馈回流
ai·可用性测试
阿钱真强道6 天前
30 嵌入式操作系统 | 上位机界面:Flask 网页显示 + 控制闭环
后端·python·flask