Muokkaa

Jaa


View Application Insights Snapshot Debugger data

Snapshots appear as Exceptions in the Application Insights pane of the Azure portal. View debug snapshots in the portal to examine the call stack and inspect variables at each call stack frame.

For a more powerful debugging experience with source code, open snapshots with Visual Studio Enterprise. You can also set SnapPoints to interactively take snapshots without waiting for an exception.

Prerequisites

Snapshots might include sensitive information. You can only view snapshots if you are assigned the Application Insights Snapshot Debugger role.

Access debug snapshots in the portal

After an exception has occurred in your application and a snapshot is created, you can view snapshots in the Azure portal within 5 to 10 minutes.

  1. In your Application Insights resource, select Investigate > Failures from the left-side menu.

  2. In the Failures pane, select either:

    • The Operations tab, or
    • The Exceptions tab.
  3. Select the [x] Samples in the center column of the page to generate a list of sample operations or exceptions to the right.

    Screenshot showing the Failures Page in Azure portal.

  4. From the list of samples, select an operation or exception to open the End-to-End Transaction Details page. From here, select the exception event you'd like to investigate.

    Screenshot showing the Open Debug Snapshot button on exception.

  5. In the Debug Snapshot page, you see a call stack with a local variables pane. Select a call stack frame to view local variables and parameters for that function call in the variables pane.

    Screenshot showing the Open debug snapshot highlighted in the Azure portal.

Download snapshots to view in Visual Studio

To view snapshots in Visual Studio 2017 Enterprise or greater:

  1. Click the Download Snapshot button in the Debug Snapshot page to download a .diagsession file, which can be opened by Visual Studio Enterprise.

  2. In Visual Studio, make sure you have the Snapshot Debugger Visual Studio component installed.

    • For Visual Studio 2017 Enterprise and greater: The required Snapshot Debugger component can be selected from the Individual Component list in the Visual Studio installer.
    • For a version older than Visual Studio 2017 version 15.5: Install the extension from the Visual Studio Marketplace.
  3. Open the .diagsession file. The Minidump Debugging page in Visual Studio appears.

  4. Click Debug Managed Code to start debugging the snapshot. The snapshot opens to the line of code where the exception was thrown.

    Screenshot showing the debug snapshot in Visual Studio.

The downloaded snapshot includes any symbol files found on your web application server. These symbol files are required to associate snapshot data with source code. For App Service apps, make sure to enable symbol deployment when you publish your web apps.

Next steps

Enable the Snapshot Debugger in your: