# deploy

Builds a Power Apps code app and deploys it to Power Platform, pushing updates to an existing app.

Skill by Microsoft. Category: Shipping and ops.

## Install

Project (for this project only):

```sh
npx skills add microsoft/power-platform-skills --skill deploy
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add microsoft/power-platform-skills --skill deploy -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.
- Runs shell commands: Its steps run shell commands in your terminal.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass

Installs: 215. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/microsoft/power-platform-skills/deploy)

## Source

[Open the source](https://github.com/microsoft/power-platform-skills/tree/HEAD/plugins/code-apps/skills/deploy). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: deploy
description: Builds and deploys a Power Apps code app to Power Platform. Use when deploying changes, redeploying an existing app, or pushing updates.
user-invocable: true
allowed-tools: Read, Edit, Write, Grep, Glob, Bash
model: sonnet
---

**📋 Shared Instructions: [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md)** - Cross-cutting concerns.

# Deploy

Builds and deploys the app in the current directory to Power Platform.

## Workflow

1. Check Memory Bank → 2. Build → 3. Deploy → 4. Update Memory Bank

---

### Step 1: Check Memory Bank

Check for `memory-bank.md` in the project root. If found, read it for the project name and environment. If not found, proceed — the project may have been created without the plugin.

### Step 2: Build

```bash
npm run build
```

If the build fails:

- **TS6133 (unused import)**: Remove the unused import and retry.
- **Other TypeScript errors**: Report the error with the file and line number and stop. Do not deploy a broken build.

Verify `dist/` exists with `index.html` before continuing.

### Step 3: Deploy

Ask the user: _"Ready to deploy to [environment name]? This will update the live app."_ Wait for explicit confirmation before proceeding.

> Resolve the CLI first (see [cli-binary.md](${PLUGIN_ROOT}/shared/cli-binary.md)): run as `$PA app push` (`npx --no-install pa …`), never a bare `pa`. On `power-apps`-only projects, translate to `power-apps push`.

```bash
pa app push
```

Capture the app URL from the output if present.

If deploy fails, report the error and stop — do not retry silently. Common fixes:

- Auth error / token expired → `pa auth logout` (or `power-apps logout` on `power-apps`-only projects), then retry — the CLI will re-prompt browser login.
- Environment mismatch → update `environmentId` in `power.config.json` to the correct value and retry.

### Step 4: Update Memory Bank

If `memory-bank.md` exists, update:

- Last deployed timestamp
- App URL (if captured)
````

- Previous: [integrate-webapi](https://syn4pse.dev/terminal/integrate-webapi.md)
- Next: [list-connections](https://syn4pse.dev/terminal/list-connections.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
