Skip to content

Commit 24a49d6

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into nw-nsgflowlogs
2 parents dc4a87c + 3a5ca9a commit 24a49d6

File tree

15 files changed

+186
-72
lines changed

15 files changed

+186
-72
lines changed

articles/azure-monitor/snapshot-debugger/snapshot-debugger-upgrade.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ author: hhunter-ms
66
ms.reviewer: charles.weininger
77
reviewer: cweining
88
ms.topic: conceptual
9-
ms.date: 08/18/2022
10-
ms.custom: devdivchpfy22, devx-track-dotnet
9+
ms.date: 07/10/2023
10+
ms.custom: devdivchpfy22, devx-track-dotnet, engagement
1111
---
1212

1313
# Upgrade the Snapshot Debugger
1414

15-
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.
1617
1718
Depending on how you enabled the Snapshot Debugger, you can follow two primary upgrade paths:
1819

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
2322

24-
## Upgrade the site extension
23+
# [Site extension](#tab/site-ext)
2524

2625
> [!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.
2828
> To avoid conflicts, which might cause your site to stop working, delete the private site extension first. See step 4 in the following procedure.
2929
3030
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
3434

3535
:::image type="content" source="./media/snapshot-debugger-upgrade/app-service-resource.png" alt-text="Screenshot that shows an individual App Service resource named DiagService01.":::
3636

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.
3838

3939
:::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.":::
4040

@@ -67,6 +67,14 @@ If you enabled the Snapshot Debugger by using the site extension, you can upgrad
6767

6868
The site is now upgraded and is ready to use.
6969

70-
## Upgrade Snapshot Debugger by using SDK/NuGet
7170

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)

articles/azure-monitor/snapshot-debugger/snapshot-debugger.md

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
11
---
2-
title: Application Insights Snapshot Debugger for .NET apps
3-
description: Debug snapshots are automatically collected when exceptions are thrown in production .NET apps.
2+
title: Debug exceptions in .NET applications using Snapshot Debugger
3+
description: Use Snapshot Debugger to automatically collect snapshots and debug exceptions in .NET apps.
44
ms.author: hannahhunter
55
author: hhunter-ms
66
ms.reviewer: charles.weininger
77
reviewer: cweining
88
ms.topic: conceptual
9-
ms.custom: devx-track-dotnet, devdivchpfy22
10-
ms.date: 04/14/2023
9+
ms.custom: devx-track-dotnet, devdivchpfy22, engagement
10+
ms.date: 07/10/2023
1111
---
1212

13-
# Debug snapshots on exceptions in .NET apps
13+
# Debug exceptions in .NET applications using Snapshot Debugger
1414

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.
1616

1717
The Snapshot Debugger in [Application Insights](../app/app-insights-overview.md):
1818

1919
- Monitors system-generated logs from your web app.
2020
- Collects snapshots on your top-throwing exceptions.
2121
- Provides information you need to diagnose issues in production.
2222

23-
To use the Snapshot Debugger, you:
23+
## How Snapshot Debugger works
2424

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:
3126

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.
3837

3938
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.
4039

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.
4848
4949
## Supported applications and environments
5050

@@ -73,9 +73,16 @@ The following environments are supported:
7373
7474
If you enabled the Snapshot Debugger but you aren't seeing snapshots, see the [Troubleshooting guide](snapshot-debugger-troubleshoot.md).
7575

76-
## Required permissions
76+
## Requirements
7777

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**.
7986

8087
For more information, see [Assign Azure roles by using the Azure portal](../../role-based-access-control/role-assignments-portal.md).
8188

@@ -92,30 +99,36 @@ Debug snapshots are stored for 15 days. The default data retention policy is set
9299

93100
### Publish symbols
94101

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.
96107

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:
98109

99110
```xml
100111
<ExcludeGeneratedDebugSymbol>False</ExcludeGeneratedDebugSymbol>
101112
```
102113

103-
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.
104117

105118
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*.
106119

107120
### Optimized builds
108121

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.
110123

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.
112125

113126
> [!TIP]
114127
> Install the Application Insights Site extension in your instance of App Service to get deoptimization support.
115128
116129
## Release notes for Microsoft.ApplicationInsights.SnapshotCollector
117130

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.
119132

120133
[Learn](./snapshot-debugger.md) more about the Application Insights Snapshot Debugger for .NET applications.
121134

@@ -164,8 +177,8 @@ Addressed multiple improvements and added support for Azure Active Directory (Az
164177
- Added back `MinidumpWithThreadInfo` when writing dumps.
165178
- Added `CompatibilityVersion` to improve synchronization between the Snapshot Collector agent and the Snapshot Uploader on breaking changes.
166179
- 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.
169182

170183
#### New features
171184
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
211224
- Deoptimization support (via ReJIT on attach) for .NET Core 3.0 applications.
212225
- Added symbols to NuGet package.
213226
- 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.
215228
- Snapshots can now be captured for exceptions in dynamically generated methods. An example is the compiled expression trees generated by Entity Framework queries.
216229

217230
#### Bug fixes
@@ -221,10 +234,10 @@ Switched to using `HttpClient` for all targets except `net45` because `WebReques
221234
- Handle `InvalidOperationException` when you're deoptimizing dynamic methods (for example, Entity Framework).
222235

223236
### [1.3.5](https://www.nuget.org/packages/Microsoft.ApplicationInsights.SnapshotCollector/1.3.5)
224-
- 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).
225238
- 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).
226239
- 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.
228241
- Added the `DeoptimizeMethodCount` configuration setting that allows deoptimization of more than one function call.
229242

230243
### [1.3.4](https://www.nuget.org/packages/Microsoft.ApplicationInsights.SnapshotCollector/1.3.4)
@@ -254,12 +267,12 @@ Fixed bug that was causing *SnapshotUploader.exe* to stop responding and not upl
254267

255268
### [1.3.0](https://www.nuget.org/packages/Microsoft.ApplicationInsights.SnapshotCollector/1.3.0)
256269
#### Changes
257-
- For applications that target .NET Framework, Snapshot Collector now depends on Microsoft.ApplicationInsights version 2.3.0 or above.
258-
It used to be 2.2.0 or above.
270+
- For applications that target .NET Framework, Snapshot Collector now depends on Microsoft.ApplicationInsights version 2.3.0 or later.
271+
It used to be 2.2.0 or later.
259272
We believe this change won't be an issue for most applications. Let us know if this change prevents you from using the latest Snapshot Collector.
260273
- Use exponential back-off delays in the Snapshot Uploader when retrying failed uploads.
261274
- Use `ServerTelemetryChannel` (if available) for more reliable reporting of telemetry.
262-
- Use `SdkInternalOperationsMonitor` on the initial connection to the Snapshot Debugger service so that it's ignored by dependency tracking.
275+
- Use `SdkInternalOperationsMonitor` on the initial connection to the Snapshot Debugger service so that dependency tracking ignores it.
263276
- Improved telemetry around initial connection to Snapshot Debugger.
264277
- Report more telemetry for the:
265278
- App Service version.

0 commit comments

Comments
 (0)