【Azure App Service】分享App Service for Window中自动抓取Memory DUMP的方法

问题描述

当应用部署到Azure App Service后,如果突然遇见应用内存上升的情况,如果想 第一时间的抓取Memory DUMP,以便于分析出内存占用到上限值的根源,有什么好的办法呢?

问题解答

如果是 Windows App Service,最简单的做法是开启 Auto-Heal:触发条件选内存上限,动作选 Collect a Memory Dump。进程私有内存超过阈值时,系统会自动抓 dump。

Auto-Heal provides you with an easy way to take an action when your app is having an unexpected behavior. The triggers and actions allow you to define various conditions based on request count, slow requests, memory limit on which you can take specific actions like restarting the process, logging an event, or starting another executable. Please note that these mitigations should only be considered a temporary workaround until you find the real cause for the issue causing the unexpected behavior.

具体的操作步骤如下:

  1. 打开 Azure Portal,进入目标 Web App。
  2. 依次点 Network → Troubleshoot → Auto-Heal。
  3. 打开 Custom Auto-Heal Rules(自定义自动修复规则)。
  4. Conditions(触发条件):选 Memory Limit,填内存阈值。这个值指的是单个实例上 w3wp 进程的 Private Bytes。
  5. Actions(动作):选 Custom Action → Collect a Memory Dump。
    • 可以选抓完 dump 后是否同时分析,或是否重启进程(Kill)。
    • 如果门户提示配置存储账户,就按提示绑定一个。dump 会写到那个存储账户里。
  6. Override when action executes(最短运行时间):建议设成 5--10 分钟,防止进程刚启动就反复触发。
  7. 点 Save。保存后站点会重启一次,规则才会生效。

操作步骤截图参考:

参考资料

Auto Healing Experience in App Service Diagnostics :Announcing the New Auto Healing Experience in App Service Diagnostics - Azure App Service


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

相关推荐
ms365copilot18 小时前
Microsoft 365 Copilot跨工作资料整理
microsoft·copilot
中二骚年1 天前
Windows 安全中心 / 防火墙故障,calc和Microsoft Store,终端(管理员)无法正常打开。 原因 + 修复方案
windows·安全·microsoft
kk_net88991 天前
微软常用运行库合集免费下载安装教程(附运行库安装包)微软运行库安装图文教程
其他·microsoft
GlobalInfo2 天前
2026年全球机器人用超平执行器市场研究报告:市场规模达7.51亿美元,人形机器人商业化与轻量化运动控制需求推动行业增长
大数据·人工智能·数码相机·microsoft·机器人
编码者卢布2 天前
【Azure Container Apps】为什么通过 Diagnostic Settings 发送到 Log Analytics 中的日志会延迟几分钟?
microsoft·azure
0x00072 天前
微软intelligent-terminal:Windows 的官方内置Agent Cli
microsoft
海盗12342 天前
微软技术日报 2026-11-02:开发者环境服务退役、Defender 清点本地 AI 代理
人工智能·microsoft·机器人·人工智能aigc
海盗12343 天前
微软技术日报 2026-11-01:语言模型 API 免申请、8 个威胁组织被分四档
人工智能·microsoft·语言模型·机器人·人工智能aigc
ShineWinsu4 天前
对于Qt:QRadioButton常见属性以及QButtonGroup的解析
数据库·c++·qt·microsoft·gui·qradiobutton·qbuttongroup
鬼手点金4 天前
提示注入:上下文安全的核心威胁
人工智能·安全·microsoft·机器学习·缓存·prompt