|
| 1 | +--- |
| 2 | +title: View Application Insights Snapshot Debugger data |
| 3 | +description: View snapshots collected by the Snapshot Debugger in either the Azure portal or Visual Studio |
| 4 | +ms.author: hannahhunter |
| 5 | +author: hhunter-ms |
| 6 | +ms.reviewer: charles.weininger |
| 7 | +reviewer: cweining |
| 8 | +ms.topic: conceptual |
| 9 | +ms.custom: devx-track-dotnet, devdivchpfy22 |
| 10 | +ms.date: 04/14/2023 |
| 11 | +--- |
| 12 | + |
| 13 | +# View Application Insights Snapshot Debugger data |
| 14 | + |
| 15 | +Snapshots appear on [**Exceptions**](../app/asp-net-exceptions.md) in the Application Insights pane of the Azure portal. |
| 16 | + |
| 17 | +You can view debug snapshots in the portal to see the call stack and inspect variables at each call stack frame. To get a more powerful debugging experience with source code, open snapshots with Visual Studio Enterprise. You can also [set SnapPoints to interactively take snapshots](/visualstudio/debugger/debug-live-azure-applications) without waiting for an exception. |
| 18 | + |
| 19 | +## View Snapshots in the Portal |
| 20 | + |
| 21 | +After an exception has occurred in your application and a snapshot has been created, you should have snapshots to view in the Azure portal within 5 to 10 minutes. To view snapshots, in the **Failure** pane, either: |
| 22 | + |
| 23 | +* Select the **Operations** button when viewing the **Operations** tab, or |
| 24 | +* Select the **Exceptions** button when viewing the **Exceptions** tab. |
| 25 | + |
| 26 | +:::image type="content" source="./media/snapshot-debugger/failures-page.png" alt-text="Screenshot showing the Failures Page in Azure portal."::: |
| 27 | + |
| 28 | +Select an operation or exception in the right pane to open the **End-to-End Transaction Details** pane, then select the exception event. If a snapshot is available for the given exception, an **Open Debug Snapshot** button appears on the right pane with details for the [exception](../app/asp-net-exceptions.md). |
| 29 | + |
| 30 | +:::image type="content" source="./media/snapshot-debugger/e2e-transaction-page.png" alt-text="Screenshot showing the Open Debug Snapshot button on exception."::: |
| 31 | + |
| 32 | +In the Debug Snapshot view, you see a call stack and a variables pane. When you select frames of the call stack in the call stack pane, you can view local variables and parameters for that function call in the variables pane. |
| 33 | + |
| 34 | +:::image type="content" source="./media/snapshot-debugger/open-snapshot-portal.png" alt-text="Screenshot showing the Open debug snapshot highlighted in the Azure portal."::: |
| 35 | + |
| 36 | +Snapshots might include sensitive information. By default, you can only view snapshots if you've been assigned the `Application Insights Snapshot Debugger` role. |
| 37 | + |
| 38 | +## View Snapshots in Visual Studio 2017 Enterprise or above |
| 39 | + |
| 40 | +1. Click the **Download Snapshot** button to download a `.diagsession` file, which can be opened by Visual Studio Enterprise. |
| 41 | + |
| 42 | +1. To open the `.diagsession` file, you need to have the Snapshot Debugger Visual Studio component installed. The Snapshot Debugger component is a required component of the ASP.NET workload in Visual Studio and can be selected from the Individual Component list in the Visual Studio installer. If you're using a version of Visual Studio before Visual Studio 2017 version 15.5, you'll need to install the extension from the [Visual Studio Marketplace](https://aka.ms/snapshotdebugger). |
| 43 | + |
| 44 | +1. After you open the snapshot file, the Minidump Debugging page in Visual Studio appears. Click **Debug Managed Code** to start debugging the snapshot. The snapshot opens to the line of code where the exception was thrown so that you can debug the current state of the process. |
| 45 | + |
| 46 | + :::image type="content" source="./media/snapshot-debugger/open-snapshot-visual-studio.png" alt-text="Screenshot showing the debug snapshot in Visual Studio."::: |
| 47 | + |
| 48 | +The downloaded snapshot includes any symbol files that were 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. |
| 49 | + |
| 50 | +## Next steps |
| 51 | + |
| 52 | +Enable the Snapshot Debugger in your: |
| 53 | +- [App Service](./snapshot-debugger-app-service.md) |
| 54 | +- [Function App](./snapshot-debugger-function-app.md) |
| 55 | +- [Virtual machine or other Azure service](./snapshot-debugger-vm.md) |
0 commit comments