【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

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

相关推荐
aGdF8E3gQ7 小时前
【Application Insights】采样率对Function App日志收集的影响和解决方法
python·flask·wpf
编码者卢布11 小时前
【Azure APIM】通过 API Management 公开API为 MCP Server 的试验 (二)
microsoft·flask·azure
编码者卢布1 天前
【Azure APIM】通过 API Management 公开现有 MCP Server 的试验 (一)
microsoft·flask·azure
汽车仪器仪表相关领域1 天前
NHA-604/605汽车排放气体测试仪:00级国标计量|多动力车型兼容|移动/固定双工况|智能联网尾气检测设备
大数据·人工智能·功能测试·安全·汽车·压力测试·可用性测试
这个人懒得名字都没写2 天前
Flask + PyArmor Gunicorn启动报错:RuntimeError: unauthorised use of script
python·flask·gunicorn·pyarmor
立心者03 天前
Sdcb Chats .. 发布,彻底移除 Azure.AI.OpenAI 专用包
人工智能·flask·azure
昆曲之源_娄江河畔4 天前
Python如何安装flask, pymssql
开发语言·python·flask·pymssql
韭菜炒鸡肝天4 天前
【App Service】在Azure环境中如何查看App Service实例当前的网络连接情况呢?
microsoft·flask·azure
看昭奚恤哭4 天前
ontainer App】Container App无法从Container Registries 拉取镜像 - 报错 Forbidden
后端·python·flask
米码收割机4 天前
【python】Flask 贵州省兴仁市藠头价格数据分析和可视化系统(源码+文档)【独一无二】
python·数据分析·flask