AgentSkillsCN

deploy-diagnostics

通过分析错误输出、检查Azure资源状态,并提出修复建议,诊断并解决Azure部署失败的问题。在azd预配失败、azd部署失败、烟雾测试在实际部署中未能通过、容器镜像无法推送/拉取,或任何第五阶段部署错误发生时使用此功能。可在部署错误、基础设施故障,或部署后烟雾测试失败时触发。

SKILL.md
--- frontmatter
name: deploy-diagnostics
description: Diagnose and resolve Azure deployment failures by analyzing error output, checking Azure resource state, and suggesting fixes. Use when azd provision fails, azd deploy fails, smoke tests fail against live deployment, container images fail to push/pull, or any Phase 5 deployment error occurs. Trigger on deployment errors, infrastructure failures, or post-deploy smoke test failures.

Deploy Diagnostics

Diagnose and resolve Azure deployment failures.

Steps

  1. Parse error output — Identify the error type from AZD stdout/stderr
  2. Classify the error — Match against known patterns (see below)
  3. Check resource state — Verify Azure resource health if accessible
  4. Suggest fix — Provide specific remediation
  5. Verify fix — After applying, re-run the failed command

Known Failure Patterns

PatternSymptomFix
Quota exceededQuotaExceeded in errorChange region or request quota increase
Name conflictConflictError or DNS takenUse a different environmentName
Image pull failureImagePullBackOffVerify ACR push succeeded and identity has AcrPull role
Bicep validationInvalidTemplateCheck infra/main.bicep syntax and parameter values
Permission deniedAuthorizationFailedVerify subscription access and required RBAC roles
Region unavailableLocationNotAvailableForResourceTypeDeploy to a supported region

Diagnostic Commands

bash
azd show                                                                    # deployment status
azd provision --debug                                                       # provisioning logs
az resource list --resource-group <rg-name> --output table                  # resource health
az containerapp logs show --name <app-name> --resource-group <rg-name>      # container app logs

Output Format

code
Error: <classification>
Root Cause: <description>
Fix: <specific action>
Confidence: HIGH | MEDIUM | LOW