Here at FelineSoft, we use a lot of Microsoft Azure - both to deploy our software and also to monitor any issues. One of the benefits this does is gives us the ability to look at any failures which have occurred within, say, the last 24 hours. However, using the limited error messages that are shown can make it difficult to work out the source of the error.

One of Microsoft's newest solutions is the “Snapshot Debugger”. This will make a very useful snapshot of all of your local variables at the time of the exception, so that you can further look into the error which directly occurred on the production system. It causes no extra time or delay to application but can be immensely valuable.

In order to use this, first install the snapshot debugging tool in Visual Studio. Do this via the Visual Studio installer:

So that Azure knows to take a snapshot, the last piece of the puzzle is to include the Snapshot collector NuGet package in your application, and optionally configure parameters in ApplicationInsights.config, then deploy it. Just follow these instructions. Once this is done, Microsoft Application Insights will show this icon whenever a snapshot has occurred (Azure portal, Application Insights, Failures, click into detail), which you can then click which will open in Visual Studio: 

In conclusion, finding the source of the error is made a lot simpler when you can explore your code through Visual Studio with all of your locals intact at the time the exception occurred, from the live production system - all without affecting your applications performance!

Simon Crouch, Junior Developer @ Felinesoft