microsoft/power-platform-skills/deploy-site
Claude Code and agent skill by microsoft/power-platform-skills
- vendor
Checking that the SKILL.md file is still in the repository.
Deploys an existing Power Pages site to a Power Pages environment using PAC CLI. Routes SPA sites to the existing build and upload-code-site workflow, and PAC-downloaded non-SPA (classic) sites to an isolated upload workflow with explicit data-model and website-identity checks. Handles tooling verification, authentication, environment confirmation, upload approval, and verification. Use when the user wants to deploy, upload, publish, or push either site type.
Install
npx vskill@latest install microsoft/power-platform-skills/deploy-siteSKILL.md
The same SKILL.md was published earlier as microsoft/power-platform-skills/deploy-site.
Plugin check: Runnode "${PLUGIN_ROOT}/scripts/check-version.js"— if it outputs a message, show it to the user before proceeding.
Deploy Power Pages Site
Route to the correct deployment workflow before running SPA build, attachment, or activation logic.
Core Principles
- Verify before acting: Always confirm PAC CLI availability, authentication status, and the target environment before attempting any deployment.
- Use TaskCreate/TaskUpdate: Track all progress throughout all phases — create the todo list upfront with all phases before starting any work.
- Never change environment settings without consent: If deployment requires modifying environment configuration (e.g., unblocking JavaScript attachments), always explain the change and get explicit user permission first.
Initial request: $ARGUMENTS
Site-Type Routing
Classify explicit request signals first:
- React, Vue, Angular, Astro, SPA, code site, or
powerpages.config.json→ SPA site - non-SPA, classic, traditional, declarative, Enhanced, EDM, Standard data model,
.portalconfig,
or website.yml → Non-SPA site
When the request is not explicit, search the current workspace for:
- SPA roots containing
powerpages.config.json; - non-SPA roots containing both
.portalconfig/andwebsite.yml, including a nested
.powerpages-site/.
Exclude dependency, build-output, temporary, generated-output, and version-control directories. Use request paths and the current directory to resolve one project. Never choose the first result arbitrarily.
<!-- gate: deploy-site:0.project-type | category=plan | cancel-leaves=nothing -->
🚦 Gate (plan · deploy-site:0.project-type): Select the exact project when SPA andnon-SPA sites, or multiple valid roots, remain possible.Trigger: Project type or root is ambiguous after discovery.Why: The two site types require incompatible PAC upload commands.Cancel leaves: Nothing; no build or upload has started.
If ambiguous, use AskUserQuestion to select the exact project root and detected type.
- Non-SPA site: Read and follow
${PLUGIN_ROOT}/skills/deploy-site/workflows/non-spa-site.md. Do not continue into the SPA phases below.
- SPA site: Continue with the existing workflow below.
Non-SPA upload approval
The authoritative markers and prompts live in workflows/non-spa-site.md. Gate deploy-site:non-spa-4.permissions-audit handles permission-sensitive changes before upload. Gate deploy-site:non-spa-5.upload approves the exact root, environment, website identity, model, and local change summary immediately before upload.
SPA-Site Deployment Workflow
The following phases retain the existing SPA behavior.
Phase 1: Verify PAC CLI
Goal: Ensure PAC CLI is installed and available on the system PATH
Actions:
- Create todo list with all 6 phases (see Progress Tracking table)
- Run
pac helpto check if the PAC CLI is installed and available on the system PATH.
``bash pac help ``
- If the command succeeds: PAC CLI is installed. Proceed to Phase 2.
- If the command fails (command not found / not recognized):
- Inform the user that PAC CLI is required but not installed.
- Fetch installation instructions from
https://aka.ms/PowerPlatformCLIusing the following approach:
- Tell the user: "PAC CLI is not installed. You can install it by running:"
``bash dotnet tool install --global Microsoft.PowerApps.CLI.Tool ``
- If
dotnetis also not available, direct the user to <https://aka.ms/PowerPlatformCLI> for full installation instructions including .NET SDK setup.
- After installation, verify by running
pac helpagain. - If it still fails, stop and ask the user to resolve the installation manually.
Output: PAC CLI installed and verified
Phase 2: Verify Authentication
Goal: Ensure the user is authenticated with PAC CLI and has a valid session
Actions:
- Run
pac auth whoto check the current authentication status.
``bash pac auth who ``
- If authenticated: Extract the following values from the output:
- Environment name and URL
- Environment ID — the GUID after
Environment ID: - Cloud — the value after
Cloud:(e.g.,Public,UsGov,UsGovHigh,UsGovDod,China)
Proceed to Phase 3.
- If not authenticated:
- Inform the user they are not authenticated with PAC CLI.
<!-- not-a-gate: free-text env URL fallback when PAC CLI auth is missing — data-gathering, no destructive action -->
- Use
AskUserQuestionto ask for the environment URL:
| Question | Header | Options | |
|---|---|---|---|
You are not authenticated with PAC CLI. Please provide your Power Pages environment URL (e.g., https://org12345.crm.dynamics.com) so I can authenticate you. | Auth | (free text input via "Other") |
Provide two placeholder options to guide the user:
- "I'll paste the URL" (description: "Select 'Other' below and paste your environment URL")
- "I don't know my URL" (description: "You can find it in the Power Platform admin center under Environments > your environment > Environment URL")
- Once the user provides the URL, run the authentication command:
``bash pac auth create --environment "<USER_PROVIDED_URL>" ``
This will open a browser window for the user to sign in.
- After the command completes, verify by running
pac auth whoagain. - If authentication succeeds, proceed to Phase 3.
- If authentication fails, present the error to the user and help them troubleshoot.
Output: Authenticated PAC CLI session with environment name and URL extracted
Phase 3: Confirm Environment
Goal: Ensure the user is deploying to the correct target environment
Actions:
<!-- gate: deploy-site:3.confirm-env | category=consent | cancel-leaves=nothing -->
🚦 Gate (consent · deploy-site:3.confirm-env): Echo the current environment and require explicit confirmation before any upload. Covers the follow-up "pick a different env" sub-prompt in the same section — wrong-env deploys are the #1 destructive shared-state failure for this skill, so this gate must fire even when PAC CLI shows a recognizable env.Trigger: Phase 3 entry; environment resolved from PAC CLI.Why we ask: Site uploaded to wrong tenant / wrong env — committed to a Dataverse instance the user did not intend; cleanup requires manual deletion or another deploy from a different env.Cancel leaves: Nothing — no upload fired.
- Present the current environment information to the user and ask them to confirm.
Use AskUserQuestion with the following structure:
| Question | Header | Options | |
|---|---|---|---|
| You are currently connected to environment: <ENV_NAME> (<ENV_URL>). Do you want to deploy to this environment? | Environment | Yes, use this environment, No, let me choose a different one |
- If "Yes, use this environment": Proceed to Phase 4.
- If "No, let me choose a different one":
- Run
pac org listto retrieve all available environments:
``bash pac org list ``
- Parse the output to extract environment names and URLs.
- Use
AskUserQuestionto present the available environments as options (pick up to 4 most relevant, or let user specify). - Once the user selects an environment, switch to it:
``bash pac org select --environment "<SELECTED_ENV_ID_OR_URL>" ``
- Verify the switch by running
pac auth whoagain.
Output: Confirmed target environment for deployment
Phase 4: Deploy the SPA Site
Goal: Locate the project, build it, and upload to Power Pages
Actions:
4.1 Locate the Project Root
Determine the project root directory. The project root is the directory containing powerpages.config.json. Use Glob to search for it:
<!-- gate: deploy-site:4.1.multi-project | category=plan | cancel-leaves=nothing -->
🚦 Gate (plan · deploy-site:4.1.multi-project): More than onepowerpages.config.jsoncandidate found — pick the right project to deploy.Trigger: Phase 4.1 glob returned multiple matches.Why we ask: Wrong project uploaded — pollutes the target env with files from a different site.Cancel leaves: Nothing — no upload fired.
If found in the current working directory or a subdirectory, use that directory as PROJECT_ROOT. If multiple are found, ask the user which one to deploy using AskUserQuestion.
If not found, ask the user to provide the path to the project root.
4.2 Offer Permissions Audit (Redeployments Only)
If .powerpages-site already exists (i.e., this is not the first deployment), table permissions and site settings may have drifted from the code since the last deployment. Offer to audit before deploying.
<!-- gate: deploy-site:4.2.audit-permissions | category=plan | cancel-leaves=nothing -->
🚦 Gate (plan · deploy-site:4.2.audit-permissions): Re-deployment detected — offer to run/audit-permissionsto catch drift between code and table permissions before push.Trigger:.powerpages-siteexists (not first deployment).Why we ask: Stale permission YAML deploys, causing 403s for users until next audit run.Cancel leaves: Nothing — audit is read-only; declining just proceeds to build + upload.
Use AskUserQuestion:
| Question | Header | Options | |
|---|---|---|---|
| This site has been deployed before. Would you like to run a permissions audit to verify table permissions match your current code before deploying? | Audit | Yes, audit permissions (Recommended), Skip — permissions are up to date |
If "Yes": Invoke /audit-permissions to run the audit. After the audit completes, resume with Step 4.3. If "Skip": Proceed to Step 4.3.
If .powerpages-site does not exist (first deployment), skip this step — there are no existing permissions to audit.
4.3 Build the Site
Before uploading, ensure the site is built:
If the build fails, stop and help the user fix the build errors before retrying.
4.4 Upload to Power Pages
Run the upload command:
If the upload succeeds: Proceed to Phase 5 to verify the deployment.
If the upload fails: Check the error message:
- If the failure is related to blocked JavaScript (
.js) attachments → proceed to Phase 6 - If the failure mentions `.html` type attachments are currently blocked → this is a misleading error. See Troubleshooting: HTML Blocked Attachment Error below
- For other errors → present the error to the user and help them troubleshoot
Output: Site built and uploaded to Power Pages
Phase 5: Verify Deployment
Goal: Confirm the deployment was successful and handle post-deployment steps
Actions:
5.1 Verify .powerpages-site Folder
Confirm .powerpages-site exists and list its contents (web-roles/, site-settings/, table-permissions/).
5.2 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 "DeploySite".
5.3 Confirm Upload Output
Review the output from the pac pages upload-code-site command in Phase 4 (or Phase 6 retry). Verify it reported a successful upload with no errors.
5.4 Commit Changes
Stage and commit deployment artifacts:
5.5 Check Activation Status
Run the activation status check:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 16 Nov 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/power-pages/skills/deploy-site/SKILL.md
Popularity
- Repository stars
- 947
- Repository forks
- 190
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/power-platform-skills/deploy-site)