You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To provide the best possible security for your data, Microsoft is moving away from TLS 1.0 and TLS 1.1 because these protocols are vulnerable to determined attackers. If you're using an older version of the site extension, it requires an upgrade to continue working. This article outlines the steps needed to upgrade your instance of Snapshot Debugger to the latest version.
15
+
> [!IMPORTANT]
16
+
> [Microsoft is moving away from TLS 1.0 and TLS 1.1](/lifecycle/announcements/transport-layer-security-1x-disablement) due to vulnerabilities. If you're using an older version of the site extension, you need to upgrade your instance of Snapshot Debugger to the latest version.
16
17
17
18
Depending on how you enabled the Snapshot Debugger, you can follow two primary upgrade paths:
18
19
19
-
* Via site extension
20
-
* Via an SDK/NuGet added to your application
21
-
22
-
This article discusses both upgrade paths.
20
+
- Via site extension
21
+
- Via an SDK/NuGet added to your application
23
22
24
-
## Upgrade the site extension
23
+
#[Site extension](#tab/site-ext)
25
24
26
25
> [!IMPORTANT]
27
-
> Older versions of Application Insights used a private site extension called *Application Insights extension for Azure App Service*. The current Application Insights experience is enabled by setting App Settings to light up a preinstalled site extension.
26
+
> Older versions of Application Insights used a private site extension called *Application Insights extension for Azure App Service*.
27
+
> The current Application Insights experience is enabled by setting App Settings to light up a preinstalled site extension.
28
28
> To avoid conflicts, which might cause your site to stop working, delete the private site extension first. See step 4 in the following procedure.
29
29
30
30
If you enabled the Snapshot Debugger by using the site extension, you can upgrade by following these steps:
@@ -34,7 +34,7 @@ If you enabled the Snapshot Debugger by using the site extension, you can upgrad
34
34
35
35
:::image type="content" source="./media/snapshot-debugger-upgrade/app-service-resource.png" alt-text="Screenshot that shows an individual App Service resource named DiagService01.":::
36
36
37
-
1.After you've moved to your resource, select the **Extensions** pane. Wait for the list of extensions to populate.
37
+
1.Select the **Extensions** pane. Wait for the list of extensions to populate.
38
38
39
39
:::image type="content" source="./media/snapshot-debugger-upgrade/application-insights-site-extension-to-be-deleted.png" alt-text="Screenshot that shows App Service Extensions showing the Application Insights extension for Azure App Service installed.":::
40
40
@@ -67,6 +67,14 @@ If you enabled the Snapshot Debugger by using the site extension, you can upgrad
67
67
68
68
The site is now upgraded and is ready to use.
69
69
70
-
## Upgrade Snapshot Debugger by using SDK/NuGet
71
70
72
-
If the application is using a version of `Microsoft.ApplicationInsights.SnapshotCollector` earlier than version 1.3.1, you must upgrade it to a [newer version](https://www.nuget.org/packages/Microsoft.ApplicationInsights.SnapshotCollector) to continue working.
71
+
# [SDK/NuGet](#tab/sdk-nuget)
72
+
73
+
If your application is using a version of `Microsoft.ApplicationInsights.SnapshotCollector` earlier than version 1.3.1, upgrade it to a [newer version](https://www.nuget.org/packages/Microsoft.ApplicationInsights.SnapshotCollector) to continue working.
74
+
75
+
---
76
+
77
+
## Next steps
78
+
79
+
-[Learn how to view snapshots](./snapshot-debugger-data.md)
80
+
-[Troubleshoot issues you encounter in Snapshot Debugger](./snapshot-debugger-troubleshoot.md)
# Debug exceptions in .NET applications using Snapshot Debugger
14
14
15
-
When an exception occurs, you can automatically collect a debug snapshot from your live web application. The debug snapshot shows the state of source code and variables at the moment the exception was thrown.
15
+
With Snapshot Debugger, you can automatically collect a debug snapshot when an exception occurs in your live .NET application. The debug snapshot shows the state of source code and variables at the moment the exception was thrown.
16
16
17
17
The Snapshot Debugger in [Application Insights](../app/app-insights-overview.md):
18
18
19
19
- Monitors system-generated logs from your web app.
20
20
- Collects snapshots on your top-throwing exceptions.
21
21
- Provides information you need to diagnose issues in production.
22
22
23
-
To use the Snapshot Debugger, you:
23
+
## How Snapshot Debugger works
24
24
25
-
- Include the [Snapshot Collector NuGet package](https://www.nuget.org/packages/Microsoft.ApplicationInsights.SnapshotCollector) in your application.
26
-
- Configure collection parameters in [`ApplicationInsights.config`](../app/configuration-with-applicationinsights-config.md).
27
-
28
-
## How snapshots work
29
-
30
-
The Snapshot Debugger is implemented as an [Application Insights telemetry processor](../app/configuration-with-applicationinsights-config.md#telemetry-processors-aspnet). When your application runs, the Snapshot Debugger telemetry processor is added to your application's system-generated logs pipeline.
25
+
The Snapshot Debugger is implemented as an [Application Insights telemetry processor](../app/configuration-with-applicationinsights-config.md#telemetry-processors-aspnet). When your application runs, the Snapshot Debugger telemetry processor is added to your application's system-generated logs pipeline. The Snapshot Debugger process is as follows:
31
26
32
-
Each time your application calls [TrackException](../app/asp-net-exceptions.md#exceptions), the Snapshot Debugger computes a problem ID from the type of exception being thrown and the throwing method.
33
-
Each time your application calls `TrackException`, a counter is incremented for the appropriate problem ID. When the counter reaches the `ThresholdForSnapshotting` value, the problem ID is added to a collection plan.
34
-
35
-
The Snapshot Debugger also monitors exceptions as they're thrown by subscribing to the [AppDomain.CurrentDomain.FirstChanceException](/dotnet/api/system.appdomain.firstchanceexception) event. When that event fires, the problem ID of the exception is computed and compared against the problem IDs in the collection plan.
36
-
37
-
If there's a match, a snapshot of the running process is created. The snapshot is assigned a unique identifier and the exception is stamped with that identifier. After the `FirstChanceException` handler returns, the thrown exception is processed as normal. Eventually, the exception reaches the `TrackException` method again. It's reported to Application Insights, along with the snapshot identifier.
27
+
1. Each time your application calls [`TrackException`](../app/asp-net-exceptions.md#exceptions):
28
+
1. The Snapshot Debugger computes a problem ID from the type of exception being thrown and the throwing method.
29
+
1. A counter is incremented for the appropriate problem ID.
30
+
1. When the counter reaches the `ThresholdForSnapshotting` value, the problem ID is added to a collection plan.
31
+
1. The Snapshot Debugger also monitors exceptions as they're thrown by subscribing to the [`AppDomain.CurrentDomain.FirstChanceException`](/dotnet/api/system.appdomain.firstchanceexception) event.
32
+
1. When this event fires, the problem ID of the exception is computed and compared against the problem IDs in the collection plan.
33
+
1. If there's a match between problem IDs, a snapshot of the running process is created.
34
+
1. The snapshot is assigned a unique identifier and the exception is stamped with that identifier.
35
+
1. After the `FirstChanceException` handler returns, the thrown exception is processed as normal.
36
+
1. Eventually, the exception reaches the `TrackException` method again. It's reported to Application Insights, along with the snapshot identifier.
38
37
39
38
The main process continues to run and serve traffic to users with little interruption. Meanwhile, the snapshot is handed off to the Snapshot Uploader process. The Snapshot Uploader creates a minidump and uploads it to Application Insights along with any relevant symbol (*.pdb*) files.
40
39
41
-
Snapshot creation tips:
42
-
* A process snapshot is a suspended clone of the running process.
43
-
* Creating the snapshot takes about 10 milliseconds to 20 milliseconds.
44
-
* The default value for `ThresholdForSnapshotting` is 1. This value is also the minimum. Your app has to trigger the same exception *twice* before a snapshot is created.
45
-
* Set `IsEnabledInDeveloperMode` to `true` if you want to generate snapshots while you debug in Visual Studio.
46
-
* The snapshot creation rate is limited by the `SnapshotsPerTenMinutesLimit` setting. By default, the limit is one snapshot every 10 minutes.
47
-
* No more than 50 snapshots per day can be uploaded.
40
+
> [!TIP]
41
+
> Snapshot creation tips:
42
+
> - A process snapshot is a suspended clone of the running process.
43
+
> - Creating the snapshot takes about 10 milliseconds to 20 milliseconds.
44
+
> - The default value for `ThresholdForSnapshotting` is 1. This value is also the minimum. Your app has to trigger the same exception *twice* before a snapshot is created.
45
+
> - Set `IsEnabledInDeveloperMode` to `true` if you want to generate snapshots while you debug in Visual Studio.
46
+
> - The snapshot creation rate is limited by the `SnapshotsPerTenMinutesLimit` setting. By default, the limit is one snapshot every 10 minutes.
47
+
> - No more than 50 snapshots per day can be uploaded.
48
48
49
49
## Supported applications and environments
50
50
@@ -73,9 +73,16 @@ The following environments are supported:
73
73
74
74
If you enabled the Snapshot Debugger but you aren't seeing snapshots, see the [Troubleshooting guide](snapshot-debugger-troubleshoot.md).
75
75
76
-
## Required permissions
76
+
## Requirements
77
77
78
-
Access to snapshots is protected by Azure role-based access control. To inspect a snapshot, you must first be added to the [Application Insights Snapshot Debugger](../../role-based-access-control/role-assignments-portal.md) role. Subscription owners can assign this role to individual users or groups for the target **Application Insights Snapshot**.
78
+
### Packages and configurations
79
+
80
+
- Include the [Snapshot Collector NuGet package](https://www.nuget.org/packages/Microsoft.ApplicationInsights.SnapshotCollector) in your application.
81
+
- Configure collection parameters in [`ApplicationInsights.config`](../app/configuration-with-applicationinsights-config.md).
82
+
83
+
### Permissions
84
+
85
+
Since access to snapshots is protected by Azure role-based access control, you must be added to the [Application Insights Snapshot Debugger](../../role-based-access-control/role-assignments-portal.md) role. Subscription owners can assign this role to individual users or groups for the target **Application Insights Snapshot**.
79
86
80
87
For more information, see [Assign Azure roles by using the Azure portal](../../role-based-access-control/role-assignments-portal.md).
81
88
@@ -92,30 +99,36 @@ Debug snapshots are stored for 15 days. The default data retention policy is set
92
99
93
100
### Publish symbols
94
101
95
-
The Snapshot Debugger requires symbol files on the production server to decode variables and to provide a debugging experience in Visual Studio.
102
+
The Snapshot Debugger requires symbol files on the production server to:
103
+
- Decode variables
104
+
- Provide a debugging experience in Visual Studio
105
+
106
+
By default, Visual Studio 2017 versions 15.2+ publishes symbols for release builds when it publishes to App Service.
96
107
97
-
Version 15.2 (or above) of Visual Studio 2017 publishes symbols for release builds by default when it publishes to App Service. In prior versions, you must add the following line to your publish profile `.pubxml` file so that symbols are published in release mode:
108
+
In prior versions, you must add the following line to your publish profile `.pubxml` file so that symbols are published in release mode:
For Azure Compute and other types, make sure that the symbol files are in the same folder of the main application .dll (typically, `wwwroot/bin`). Or they must be available on the current path.
114
+
For Azure Compute and other types, make sure that the symbol files are either:
115
+
- In the same folder of the main application `.dll` (typically, `wwwroot/bin`), or
116
+
- Available on the current path.
104
117
105
118
For more information on the different symbol options that are available, see the [Visual Studio documentation](/visualstudio/ide/reference/advanced-build-settings-dialog-box-csharp). For best results, we recommend that you use *Full*, *Portable*, or *Embedded*.
106
119
107
120
### Optimized builds
108
121
109
-
In some cases, local variables can't be viewed in release builds because of optimizations that are applied by the JIT compiler.
122
+
In some cases, local variables can't be viewed in release builds because of optimizations applied by the JIT compiler.
110
123
111
-
However, in App Service, the Snapshot Collector can deoptimize throwing methods that are part of its collection plan.
124
+
However, in App Service, the Snapshot Debugger can deoptimize throwing methods that are part of its collection plan.
112
125
113
126
> [!TIP]
114
127
> Install the Application Insights Site extension in your instance of App Service to get deoptimization support.
115
128
116
129
## Release notes for Microsoft.ApplicationInsights.SnapshotCollector
117
130
118
-
This article contains the release notes for the `Microsoft.ApplicationInsights.SnapshotCollector` NuGet package for .NET applications, which is used by the Application Insights Snapshot Debugger.
131
+
This section contains the release notes for the `Microsoft.ApplicationInsights.SnapshotCollector` NuGet package for .NET applications, which is used by the Application Insights Snapshot Debugger.
119
132
120
133
[Learn](./snapshot-debugger.md) more about the Application Insights Snapshot Debugger for .NET applications.
121
134
@@ -164,8 +177,8 @@ Addressed multiple improvements and added support for Azure Active Directory (Az
164
177
- Added back `MinidumpWithThreadInfo` when writing dumps.
165
178
- Added `CompatibilityVersion` to improve synchronization between the Snapshot Collector agent and the Snapshot Uploader on breaking changes.
166
179
- Changed `SnapshotUploader` LogFile naming algorithm to avoid excessive file I/O in App Service.
167
-
- Added pid, role name, and process start time to uploaded blob metadata.
168
-
- Used `System.Diagnostics.Process`where possible in Snapshot Collector and Snapshot Uploader.
180
+
- Added `pid`, `role name`, and `process start time` to uploaded blob metadata.
181
+
- Used `System.Diagnostics.Process` in Snapshot Collector and Snapshot Uploader.
169
182
170
183
#### New features
171
184
Added Azure AD authentication to `SnapshotCollector`. To learn more about Azure AD authentication in Application Insights, see [Azure AD authentication for Application Insights](../app/azure-ad-authentication.md).
@@ -211,7 +224,7 @@ Switched to using `HttpClient` for all targets except `net45` because `WebReques
211
224
- Deoptimization support (via ReJIT on attach) for .NET Core 3.0 applications.
212
225
- Added symbols to NuGet package.
213
226
- Set more metadata when you upload minidumps.
214
-
- Added an `Initialized` property to `SnapshotCollectorTelemetryProcessor`. It's a `CancellationToken`, which is canceled when the Snapshot Collector is completely initialized and connected to the service endpoint.
227
+
- Added an `Initialized` property to `SnapshotCollectorTelemetryProcessor`. It's a `CancellationToken`, which is canceled when the Snapshot Collector is initialized and connected to the service endpoint.
215
228
- Snapshots can now be captured for exceptions in dynamically generated methods. An example is the compiled expression trees generated by Entity Framework queries.
216
229
217
230
#### Bug fixes
@@ -221,10 +234,10 @@ Switched to using `HttpClient` for all targets except `net45` because `WebReques
221
234
- Handle `InvalidOperationException` when you're deoptimizing dynamic methods (for example, Entity Framework).
- Added support for sovereign clouds (older versions won't work in sovereign clouds).
237
+
- Added support for sovereign clouds (older versions don't work in sovereign clouds).
225
238
- Adding Snapshot Collector made easier by using `AddSnapshotCollector()`. For more information, see [Enable Snapshot Debugger for .NET apps in Azure App Service](./snapshot-debugger-app-service.md).
226
239
- Use the FISMA MD5 setting for verifying blob blocks. This setting avoids the default .NET MD5 crypto algorithm, which is unavailable when the OS is set to FIPS-compliant mode.
227
-
- Ignore .NET Framework frames when deoptimizing function calls. This behavior can be controlled by the `DeoptimizeIgnoredModules` configuration setting.
240
+
- Ignore .NET Framework frames when deoptimizing function calls. Control this behavior with the `DeoptimizeIgnoredModules` configuration setting.
228
241
- Added the `DeoptimizeMethodCount` configuration setting that allows deoptimization of more than one function call.
0 commit comments