
diagnose-deployment
Surfaces PAC CLI upload errors and Dataverse async operation errors, pattern-matches against a known failure catalog, and optionally auto-fixes identified issues. Use when asked to: "diagnose deployment", "debug deployment", "deployment failed", "show deployment errors", "fix deployment issues", "show upload logs", "why did my deploy fail", or "troubleshoot upload".
- Installs
- 155
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/microsoft/power-platform-skills --skill diagnose-deployment- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads diagnose-deployment automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Plugin check: Run
node "${PLUGIN_ROOT}/scripts/check-version.js"— if it outputs a message, show it to the user before proceeding.
diagnose-deployment
Surfaces and pattern-matches deployment errors against a known failure catalog. For each identified error with an available auto-fix, asks explicit user permission before applying any changes. Never auto-applies fixes without confirmation.
Prerequisites
- Project root with
powerpages.config.json - PAC CLI installed (will report if missing)
Phases
Phase 1 — Verify Prerequisites and Locate Project
Create all tasks upfront at the start of this phase.
Tasks to create:
- "Verify prerequisites and locate project"
- "Collect deployment artifacts"
- "Surface upload errors"
- "Query solution import status"
- "Diagnose and categorize findings"
- "Offer auto-fixes"
- "Present findings summary"
Steps:
- Locate project root: search for
powerpages.config.jsonin cwd and parent directories - Check PAC CLI:
pac --version(report version or "not installed") - Check PAC CLI auth:
pac env who(report environment URL or "not authenticated") - Check Azure CLI:
az account show(report subscription or "not logged in")
Auth failures are non-blocking — report them as findings, continue collecting other artifacts.
Phase 1.5 — Ground in current ALM documentation
Reference:
${PLUGIN_ROOT}/references/alm-docs-grounding.md
Cap this step at ~30 seconds. If MCP search / fetch errors out, log a one-line note and continue — this skill must remain runnable offline.
- Run
microsoft_docs_searchwith the query:Power Pages deployment errors solution import troubleshooting. - Fetch
https://learn.microsoft.com/en-us/power-platform/alm/solution-concepts-alm(and at most one sister page on troubleshooting or known import errors) in parallel viamicrosoft_docs_fetch. - Extract a one-paragraph summary of what Microsoft Learn currently says about common deployment failures and their resolution. Compare against
${PLUGIN_ROOT}/references/deployment-error-catalog.mdand flag any new error patterns not yet captured in the catalog. - Use the summary to inform pattern-matching in Phase 5. If a new pattern is documented on Learn that isn't in the catalog, surface it to the user as a candidate addition rather than silently extending the catalog.
Phase 2 — Collect Deployment Artifacts
Gather all available context:
- Read
powerpages.config.json— extractsiteName,websiteRecordId,compiledPath - Check
.powerpages-site/folder exists - Glob for manifest files:
.powerpages-site/*-manifest.yml— list all found, note their environment hostnames - Check if
.solution-manifest.jsonexists (for solution-related diagnostics) - Check if
docs/alm/last-import.jsonexists (for recent import failures) - Check build output: confirm
{compiledPath}/exists and is non-empty
Report: "Found project: {siteName}. Artifacts collected."
Phase 3 — Surface Upload Errors
Re-run pac pages upload-code-site in capture mode to get fresh error output:
pac pages upload-code-site --rootPath "." 2>&1
Note: This intentionally triggers the upload to capture any errors. If the upload succeeds cleanly, that is also a valid diagnostic result ("no errors found").
Capture stdout+stderr as a single string. Pass to scripts/parse-deployment-errors.js:
echo "{escaped-output}" | node "${PLUGIN_ROOT}/scripts/parse-deployment-errors.js"
Parse the JSON findings array. If the upload succeeded with no errors, note this and skip to Phase 5 with an empty findings list.
Phase 4 — Query Solution Import Status
Only run if .solution-manifest.json exists.
- Acquire Azure CLI token for environment URL
- Check recent async operations (last 24 hours):
GET {envUrl}/api/data/v9.2/asyncoperations?$filter=statecode eq 3 and statuscode eq 31 and createdon gt {yesterday}&$select=asyncoperationid,name,message,friendlymessage,statuscode,completedon&$orderby=completedon desc&$top=5 - Check recent import jobs:
GET {envUrl}/api/data/v9.2/importjobs?$select=solutionname,completedon,progress&$orderby=completedon desc&$top=3 - If failed operations found, pass each
messagefield throughparse-deployment-errors.js
Skip gracefully if auth is not available (auth failure in Phase 1).
Phase 5 — Auto-Diagnose Known Issues
Consolidate all findings from Phases 3 and 4. For each finding, categorize:
- Error: Blocks deployment
- Warning: May cause issues
- Info: Informational
Also add findings for missing artifacts discovered in Phase 2:
- Missing
websiteRecordId→ Error (patternId:missing-website-record-id) - Empty build output → Error (patternId:
empty-build) - Multiple environment manifests → Warning (may indicate environment confusion)
Present all findings in a table:
| # | Severity | Type | Issue | Auto-fix? |
|---|---|---|---|---|
| 1 | Error | upload | JavaScript uploads blocked | Yes |
| 2 | Warning | config | Multiple manifest files found | No |
Phase 6 — Offer Auto-Fixes
For each Error finding with autoFixAvailable: true, in order:
🚦 Gate (consent · diagnose-deployment:6.auto-fix): Per-finding consent before applying any auto-fix. Loops once per Error finding with
autoFixAvailable: true— each finding gets its own Yes / No / Skip-allAskUserQuestion. The pattern ID surfaces in the prompt. Never batch fixes — three findings = three separate consent prompts (unless the user picks "Skip all" on the first, which short-circuits the loop). The Yes from finding 1 does NOT cover finding 2; each fix has its own blast radius (different files, different settings, different reversibility).
-
Explain the issue and proposed fix
-
Ask explicit permission via
AskUserQuestion:"Issue: {message} Proposed fix: {suggestedFix} Apply this fix? Yes / No / Skip all auto-fixes"
-
If approved, execute the fix:
stale-manifest: Delete*-manifest.ymlfile(s) in.powerpages-site/# Ask which manifest to delete if multiple found, then: rm ".powerpages-site/{manifestFile}"blocked-js: Updateblockedattachmentssetting# Get current setting first pac env list-settings | grep -i blocked # Remove .js from the blocked list (preserve other blocked types) pac env update-settings --name blockedattachments --value "{updated-value}"missing-website-record-id: Retrieve and update record IDpac pages list # Parse output, find matching site by name, then update powerpages.config.jsonauth-expired: Guide re-authenticationpac auth create --environment "{envUrl}" az loginempty-build: Run buildnpm run build -
After each fix, re-run the relevant check to verify it resolved the issue. Update finding status to "Fixed" or "Manual required".
Key Constraint: Never apply any fix without explicit user permission. Each fix requires a separate confirmation.
Phase 7 — Present Findings Summary
Display a final summary table of all findings:
| # | Severity | Type | Issue | Status |
|---|---|---|---|---|
| 1 | Error | upload | JS uploads blocked | Fixed |
| 2 | Error | config | Missing websiteRecordId | Manual required |
| 3 | Warning | config | Multiple manifest files | Informational |
Status values:
- Fixed: Auto-fix was applied and verified
- Manual required: No auto-fix available — show manual steps
- Skipped: User declined the fix
- Informational: Warning/Info, no action needed
If all errors are resolved: suggest retrying deployment with /power-pages:deploy-site.
If manual steps remain: list them explicitly with commands or links.
Record Skill Usage
Reference:
${PLUGIN_ROOT}/references/skill-tracking-reference.md
Follow the skill tracking instructions in the reference to record this skill's usage. Use --skillName "DiagnoseDeployment".
Key Decision Points (Wait for User)
- Phase 6: Each individual auto-fix requires explicit confirmation before applying
- Phase 6: If user says "Skip all auto-fixes", stop offering fixes and go to summary
Error Handling
- If
pac pages upload-code-siteproduces no output: report "No upload errors detected in current state" - If Azure CLI token unavailable: skip Phase 4, note in summary
- If
parse-deployment-errors.jsreturns no findings: report "No known error patterns detected" and show raw output for manual review
Progress Tracking Table
| Task subject | activeForm | Description |
|---|---|---|
| Verify prerequisites and locate project | Verifying prerequisites | Check PAC CLI, Azure CLI, locate project root and powerpages.config.json |
| Collect deployment artifacts | Collecting deployment artifacts | Read config, list manifests, check build output, check solution manifest |
| Surface upload errors | Surfacing upload errors | Re-run pac pages upload-code-site in capture mode, parse stdout/stderr |
| Query solution import status | Querying solution import status | Check recent failed async operations and import jobs in Dataverse |
| Diagnose and categorize findings | Diagnosing findings | Pattern-match all errors against deployment-error-catalog, assign severity |
| Offer auto-fixes | Applying auto-fixes | For each fixable error, ask permission and execute fix, verify result |
| Present findings summary | Presenting summary | Show all findings table with severity and fix status, list manual steps |
FAQ
What does the diagnose-deployment skill do?
Surfaces PAC CLI upload errors and Dataverse async operation errors, pattern-matches against a known failure catalog, and optionally auto-fixes identified issues. Use when asked to: "diagnose deployment", "debug deployment", "deployment failed", "show deployment errors", "fix deployment issues", "show upload logs", "why did my deploy fail", or "troubleshoot upload".
How do I install diagnose-deployment?
Run npx skills add https://github.com/microsoft/power-platform-skills --skill diagnose-deployment in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/diagnose-deployment/ (personal) or .claude/skills/diagnose-deployment/ (project).
Which AI agents can use diagnose-deployment?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is diagnose-deployment safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains diagnose-deployment?
It is published by microsoft in microsoft/power-platform-skills, and it is an official skill from the maker of the technology it covers. It has 155 recorded installs.
More from microsoft/power-platform-skills
add-sharepoint
microsoft/power-platform-skills
Adds SharePoint Online connector to a Power Apps code app. Use when reading lists, managing documents, or integrating with SharePoint sites. Can also create new SharePoint lists.
create-code-app
microsoft/power-platform-skills
Creates Power Apps code apps using React and Vite. Use when building code apps, scaffolding projects, or deploying to Power Platform.
add-dataverse
microsoft/power-platform-skills
Adds Dataverse tables to a Power Apps code app with generated TypeScript models and services. Can also create new Dataverse tables. Use when connecting to Dataverse, adding tables, creating schema, or querying Dataverse data.
configure-canvas-mcp
microsoft/power-platform-skills
Open the skill to read its SKILL.md instructions.
add-office365
microsoft/power-platform-skills
Open the skill to read its SKILL.md instructions.
canvas-app
microsoft/power-platform-skills
Creates or edits a Power Apps Canvas App through the Canvas Authoring MCP coauthoring session. Handles staged experience design, direct and partitioned targeted edits, planned multi-screen changes, responsive layout, and compile-error convergence. Trigger on requests to create, build, generate, modify, update, change, fix, or edit a Canvas App or .pa.yaml files.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.