【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

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

相关推荐
Keith Guo1 天前
What does device twin mean in azure cloud?
azure·iot
大泽九章1 天前
XSS入门:存储型、反射型、DOM型,用Flask全复现
python·网络安全·flask
Keith Guo1 天前
What does IoT Central raw data mean?
物联网·azure·iot
2601_949847752 天前
Cookie 跨端三方库仓颉适配全流程
python·django·flask
Navicat中国5 天前
Navicat 18 支持 Azure OpenAI 接入,合规 AI 赋能 SQL 开发
数据库·人工智能·microsoft·ai·azure·navicat·数据
tryCbest5 天前
Python之Flask项目部署到阿里云
python·阿里云·flask
心运软件7 天前
Fashion-MNIST 图像分类实战:TensorFlow 五模型对比与 Flask 可视化
分类·flask·tensorflow
编码者卢布7 天前
【Azure Storage Account】Azure Queue指标中的Transactions 高,真实业务处理的消息就多吗?
microsoft·flask·azure
狗凯之家源码网8 天前
梦幻邮件群发系统 1.0 定时发送效果实测
可用性测试
我命由我123458 天前
SQL 检测脚本
java·数据库·sql·功能测试·单元测试·压力测试·可用性测试