I came across an issue where I needed to collect a memory dump of the Hybrid Connection process on an app service (workerforwarder). This issue was we needed this to automated based on thread count and the default mechanisms in app services did not support capturing a dump of this process.
The second issue is running procdump requires specifying the process ID or process name. Since there’s two processes, one for the main w3wp.exe both with the name workerforwarder, I had to devise a script to capture a dump of both process.
I used the script below to run a custom Action from Auto-Heal.
Start-Transcript Dumplog.txt -Append get-date -Format "dd.MM.yyyy HH:mm:ss" $task = get-process -name workerforwarder $task.Id d:\devtools\sysinternals\procdump -accepteula -ma $task.Id Start-Sleep -Seconds 5 $task.Id d:\devtools\sysinternals\procdump -accepteula -ma $task.Id Stop-Process -Id $task.Id Stop-Process -Id $task.Id $taskw3wp = get-process -name w3wp $taskw3wp.Id $taskw3wp.Id Stop-Process -Id $taskw3wp.Id Stop-Process -Id $taskw3wp.Id Stop-Transcript
Command: PowerShell.exe -command “D:\home\site\dump.ps1”