Search code examples
azureazure-application-insights

How do I enable snapshot debugging with an on premise app service?


I have been struggling for the better part of a week to figure out how to enable snapshot debugging with an on premise c# app service. The app is already reporting to application insights, and capturing failures. However, no debugging images are showing up.

  1. I have followed these instructions to add snapshot debugging:

https://learn.microsoft.com/en-us/azure/azure-monitor/snapshot-debugger/snapshot-debugger-vm#configure-snapshot-collection-for-other-net-applications

However, this has had no effect.

  1. One possible issue is that our firewall normally blocks outbound connections from our servers, and addresses / ips have to be whitelisted. Looking over the documentation here, do I need to whitelist all of these addresses for snapshot debugging? Also, I have been told that our firewall does not allow wildcards.

https://learn.microsoft.com/en-us/azure/azure-monitor/app/ip-addresses#snapshot-debugger

  1. I have also read about a snapshot debugger uploader that is referenced in several articles, but I can not find out where to download it, or how to configure it.

Can someone please help me figure out how to get this working? Or is there some kind of log that can tell me what's going wrong?

  1. More information The app is compiled with .net core 7, and I am using Visual Studio 2022.

Solution

  • The Snapshot Debugger connects to endpoints in the AzureMonitor Service Tag range. See https://learn.microsoft.com/azure/azure-monitor/snapshot-debugger/snapshot-debugger-troubleshoot#edit-network-proxy-or-firewall-rules

    You will need to modify the rules on your firewall to allow traffic to all IP addresses within the AzureMonitor ranges. See https://learn.microsoft.com/azure/virtual-network/service-tags-overview#service-tags-on-premises for instructions.

    In addition to AzureMonitor, you'll also need to allow the Storage Service Tag because snapshots (memory dumps and symbols) are uploaded to blob storage.