deploy
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese📋 Shared Instructions: shared-instructions.md - Cross-cutting concerns.
📋 通用说明:shared-instructions.md - 跨领域相关事项。
Deploy
部署
Builds and deploys the app in the current directory to Power Platform.
将当前目录下的应用构建并部署至Power Platform。
Workflow
工作流程
- Check Memory Bank → 2. Build → 3. Deploy → 4. Update Memory Bank
- 检查内存存储库 → 2. 构建 → 3. 部署 → 4. 更新内存存储库
Step 1: Check Memory Bank
步骤1:检查内存存储库
Check for in the project root. If found, read it for the project name, environment, and current version. If not found, proceed — the project may have been created without the plugin.
memory-bank.md检查项目根目录下是否存在。如果找到,读取其中的项目名称、环境和当前版本信息。如果未找到,继续执行——该项目可能未使用插件创建。
memory-bank.mdStep 2: Build
步骤2:构建
powershell
npm run buildIf 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 exists with before continuing.
dist/index.htmlpowershell
npm run build如果构建失败:
- TS6133(未使用的导入):移除未使用的导入后重试。
- 其他TypeScript错误:报告包含文件和行号的错误并停止操作。请勿部署构建失败的应用。
继续执行前,请确认目录存在且包含文件。
dist/index.htmlStep 3: Deploy
步骤3:部署
Ask the user: "Ready to deploy to [environment name]? This will update the live app." Wait for explicit confirmation before proceeding.
bash
pwsh -NoProfile -Command "pac code push"Capture the app URL from the output if present.
If deploy fails, report the error and stop — do not retry silently. Common fixes are in the troubleshooting guide:
- Auth error →
pwsh -NoProfile -Command "pac auth create" - Environment mismatch →
pwsh -NoProfile -Command "pac env select --environment <id>"
Mac fallback — if fails with an auth error on macOS:
has known authentication bugs on Mac that can block the push. Use the npx CLI instead:
pac code pushpacbash
npm install -g @microsoft/power-apps-cli # skip if already installed
npx power-apps pushThis is functionally equivalent to and bypasses the Mac auth issue.
pac code push询问用户:“是否准备部署至[环境名称]?此操作将更新线上应用。” 等待用户明确确认后再继续执行。
bash
pwsh -NoProfile -Command "pac code push"如果输出中包含应用URL,请记录该地址。
如果部署失败,报告错误并停止操作——请勿静默重试。常见问题修复方法见故障排除指南:
- 认证错误 →
pwsh -NoProfile -Command "pac auth create" - 环境不匹配 →
pwsh -NoProfile -Command "pac env select --environment <id>"
Mac系统备选方案——若macOS上因认证错误失败:
在Mac上存在已知的认证Bug,可能会阻止推送操作。请改用npx CLI:
pac code pushpacbash
npm install -g @microsoft/power-apps-cli # 已安装可跳过
npx power-apps push此命令与功能等效,可绕过Mac系统的认证问题。
pac code pushStep 4: Update Memory Bank
步骤4:更新内存存储库
If exists, increment the version (e.g., → ) and update:
memory-bank.mdv1.0.0v1.1.0- Current version
- Last deployed timestamp
- App URL (if captured)
如果存在,将版本号递增(例如: → )并更新以下内容:
memory-bank.mdv1.0.0v1.1.0- 当前版本
- 最后部署时间戳
- 应用URL(若已记录)