AGENT SKILL

调试快照文件下载

download-snapshot

从 Application Insights Snapshot Debugger 下载快照转储(snapshot dump)文件。当需要下载、保存或导出快照或 .dmp 文件进行离线调试时使用此技能。

License 许可
MIT
最近更新
2026-06-18
Stars
★ 5
Forks
4

01 前言 Front Matter

name
download-snapshot
category
investigating
description
Download a snapshot dump file from Application Insights Snapshot Debugger. Use this when asked to download, save, or export a snapshot or .dmp file for offline debugging.

02 资源文件 3

03 SKILL.md 正文

Download Snapshot

This skill downloads a snapshot dump artifact from the Application Insights Snapshot Debugger dataplane API. The downloaded file can be opened in Visual Studio, WinDbg, or dotnet-dump for offline exception analysis.

Prerequisites

  • The user must be logged in to Azure CLI (az login)
  • The user must provide an Application Insights app ID (GUID) or resource ID

Steps

1–2. Check investigation notes and gather inputs

Follow the Standard Skill Preamble to check for existing investigation context and gather inputs.

In addition to the standard App ID, this skill requires:

  • Time range (optional): How far back to look for snapshots. Defaults to 7 days (P7D).
  • Output path (optional): Where to save the downloaded file. Defaults to the current directory.

3. Acquire an access token

Run the script in get-access-token.md to acquire a Bearer token for the dataplane. See the token freshness and session scoping guidance in that document — re-acquire the token in the same command block as each API call.

4. List available snapshots

Run the script in list-snapshots.md to call the ingested artifacts endpoint and list available snapshot dumps.

Display only the 10 most recent snapshots by default. If more snapshots exist, tell the user the total count and offer to show more. The API can return many snapshots for active applications, which produces overwhelming output.

Present the results to the user with:

  • Timestamp (triggerTime — when the snapshot was captured)
  • Role name
  • Role instance (machine/container name)
  • Artifact ID

Let the user pick which snapshot to download. If there's only one result, confirm it with the user before proceeding.

5. Download the selected snapshot

Run the script in download-snapshot-file.md with the selected artifactId. The script:

  1. Calls the artifact download endpoint (GET /artifacts/{artifactId})
  2. Follows the 302 redirect to the SAS-protected blob URL
  3. Downloads the snapshot file to the specified output path

6. Present the result

After downloading, tell the user:

  • Where the file was saved
  • The file size
  • How to open it — see snapshot-file-info.md for guidance on tools and formats

Response format

See snapshot-file-info.md for information about snapshot file formats and how to open them.

Troubleshooting

401 Unauthorized

  1. Verify the user is logged in: az account show
  2. Re-authenticate: az login
  3. Ensure the correct subscription is selected: az account set --subscription <subscription-id>
  4. Try acquiring the token manually: az account get-access-token --resource "api://dataplane.diagnosticservices.azure.com"

Empty snapshot list

  1. Check the time range — snapshots may have been captured outside the default 7-day window. Try P30D.
  2. Verify the App ID — ensure it matches the Application Insights resource with Snapshot Debugger enabled.
  3. Confirm Snapshot Debugger is enabled — the feature must be turned on in the Application Insights resource. Check the Azure portal under Application Insights → Snapshot Debugger.

404 Not Found during download

  1. Expired snapshot — snapshots have a retention period. Very old snapshots may have been purged from storage.
  2. Wrong artifact ID — verify the artifact ID matches a snapshot from the listing.
  3. Try again — transient storage issues can cause temporary 404s. Wait a moment and retry.

04 同仓库更多 Skills

microsoft
microsoft/code-optimizations-skills

性能瓶颈分析与优化

perf-optimization

基于性能分析器(profiler)和代码优化来分析性能问题的指南,涵盖 CPU、延迟和吞吐量。当被要求排查性能瓶颈或优化应用性能时使用此技能。

软件开发工程师调试与故障排查
★ 5
microsoft
microsoft/code-optimizations-skills

快照调试器异常信息获取

get-snapshot-debug-info

从 Application Insights Snapshot Debugger 快照中获取异常详情、调用堆栈和变量值。当被要求检查快照、查看异常信息、调试异常或查看崩溃时的变量值时使用此技能。

软件开发工程师调试与故障排查
★ 5
microsoft
microsoft/code-optimizations-skills

应用洞察 Profiler 热点路径分析

get-profile-hotpath

从 Application Insights Profiler 跟踪中获取并显示热点路径。当被要求获取 App Insights 资源的热点路径、调用树或跟踪分析时使用此技能。

SRE 工程师调试与故障排查
★ 5
microsoft
microsoft/code-optimizations-skills

Application Insights 错误排查

error-exploration

在 Application Insights 中排查错误——异常、失败的请求以及失败的依赖项。当用户要求查找错误、调查故障、识别可靠性问题,或推荐应优先修复的错误时使用此技能。

SRE 工程师调试与故障排查
★ 5
microsoft
microsoft/code-optimizations-skills

启用 Application Insights 快照调试器

enable-snapshot-debugger

指导用户在其平台上为 .NET 启用 Application Insights Snapshot Debugger。当用户要求启用快照调试器、设置快照收集,或快照数据缺失时使用此技能。

软件开发工程师调试与故障排查
★ 5
microsoft
microsoft/code-optimizations-skills

启用 Application Insights 性能分析器

enable-profiler

指导用户在其平台上为 .NET 启用 Application Insights Profiler。当用户要求启用分析器、设置性能分析,或分析器数据缺失时使用此技能。

SRE 工程师运维监控与告警
★ 5