Skip to content

Commit 6d0a7ae

Browse files
committed
Add ShadowCopyFolder section to App Insights Snapshot Debugger
1 parent cde15fa commit 6d0a7ae

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

articles/application-insights/app-insights-snapshot-debugger.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,44 @@ Follow these steps to configure your Cloud Service role with a dedicated local r
398398
</TelemetryProcessors>
399399
```
400400

401+
### Overriding the Shadow Copy folder
402+
403+
When the Snapshot Collector starts up, it tries to find a folder on disk that is suitable for running the Snapshot Uploader process.
404+
The Snapshot Collector checks a few well-known locations (e.g. environment variables LOCALAPPDATA, APPDATA and TEMP), making sure it has permissions to copy the Snapshot Uploader binaries. The chosen folder is known as the Shadow Copy folder.
405+
406+
If a suitable folder cannot be found, Snapshot Collector reports an error saying _"Could not find a suitable shadow copy folder."_
407+
408+
If the copy fails, Snapshot Collector reports a `ShadowCopyFailed` error.
409+
410+
If the uploader cannot be launched, Snapshot Collector reports an `UploaderCannotStartFromShadowCopy` error, possibly with a `System.UnauthorizedAccessException` in the body of the message. This is usually because the application is running under an account with reduced permissions. The account has permission to write to the shadow copy folder, but it doesn't have permission to execute code.
411+
412+
Since these errors usually happen during startup, they will usually be followed by an `ExceptionDuringConnect` error saying _"Uploader failed to start."_
413+
414+
To work around these errors, you can specify the shadow copy folder manually via the `ShadowCopyFolder` configuration option. For example, using ApplicationInsights.config:
415+
416+
```xml
417+
<TelemetryProcessors>
418+
<Add Type="Microsoft.ApplicationInsights.SnapshotCollector.SnapshotCollectorTelemetryProcessor, Microsoft.ApplicationInsights.SnapshotCollector">
419+
<!-- Override the default shadow copy folder. -->
420+
<ShadowCopyFolder>D:\SnapshotUploader</ShadowCopyFolder>
421+
<!-- Other SnapshotCollector configuration options -->
422+
</Add>
423+
</TelemetryProcessors>
424+
```
425+
426+
Or, if you are using appsettings.json with a .NET Core application:
427+
428+
```json
429+
{
430+
"ApplicationInsights": {
431+
"InstrumentationKey": "<your instrumentation key>"
432+
},
433+
"SnapshotCollectorConfiguration": {
434+
"ShadowCopyFolder": "D:\\SnapshotUploader"
435+
}
436+
}
437+
```
438+
401439
### Use Application Insights search to find exceptions with snapshots
402440

403441
When a snapshot is created, the throwing exception is tagged with a snapshot ID. That snapshot ID is included as a custom property when the exception telemetry is reported to Application Insights. Using **Search** in Application Insights, you can find all telemetry with the `ai.snapshot.id` custom property.

0 commit comments

Comments
 (0)