【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 的入站规则中放行**ActionGroupApplicationInsightsAvailabilityAzureMonitor**服务标记,并仅开放应用实际需要的端口(通常为 TCP 443)。

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

(文档链接: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

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

相关推荐
会飞锦鲤1 天前
基于YOLOv10的瓜果成熟度智能检测系统
人工智能·python·深度学习·yolo·flask
许彰午3 天前
85_Python Flask开发RESTful API
python·flask·restful
2401_894915534 天前
Geo搜索优化排名源码部署搭建全流程详解
android·开发语言·flask·php·精选
江华森4 天前
深入理解 Flask 实现原理
后端·python·flask
IT大白鼠5 天前
CVE-2026-7531 Azure Linux MariaDB PQC 内存破坏漏洞详解
linux·mariadb·azure·cve-2026-7531
weixin_BYSJ19876 天前
SpringBoot + MySQL 乒乓球运动员信息管理系统项目实战--附源码04954
java·javascript·spring boot·python·django·flask·php
纸小铭6 天前
[MAF预定义ChatClient中间件-01]LoggingChatClient——在调用LLM前后输出日志
python·中间件·flask
纸小铭6 天前
Azure MCP 工具现已内置集成至 Visual Studio 2022,无需额外安装扩展
microsoft·azure·visual studio
喜欢的名字被抢了7 天前
FastAPI 取代 Flask 的底层逻辑:一场类型驱动的 API 架构革命
架构·flask·fastapi