Logo Deploy

Deploy

Tổ chức
microsoft
deploy

Use to deploy, publish, or push an Expo/React Native Power Apps mobile app to a Power Platform tenant.

Tổng quan

Nhà phát hànhmicrosoft
Kho mãpower-platform-skills
Tên kỹ năngdeploy
Sao
895
Bản fork
182
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được microsoft công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Deploy trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/skills/deploy
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/microsoft/power-platform-skills.git /tmp/power-platform-skills
mkdir -p .claude/skills
cp -r /tmp/power-platform-skills/plugins/mobile-apps/skills/deploy .claude/skills/deploy
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Deploy trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Deploy ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Deploy không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

📋 Shared instructions: shared-instructions.md — read first.

Deploy

Builds the mobile app in the current directory and pushes it to the Power Platform environment recorded in power.config.json.

This skill uses the standard 4-step deployment flow for this plugin: check memory bank, build, deploy, then update memory bank.

Out of scope (deliberately)

  • expo run:ios / expo run:android — local native compile is the user's choice; run your platform-specific native command directly when ready.
  • OTA updates and store distribution — out of scope for v0.
  • Starting Metro for local dev — created apps use npm run dev; template Metro config writes .powernative logs for /debug-app.

Workflow

  1. Check memory bank → 1.5 App ID preflight → 2. Build → 2.4 Native package → 2.5 Offline profile coverage gate → 3. Deploy → 4. Update memory bank

Step 1 — Check memory bank

Read memory-bank.md from the project root if present. Capture:

  • Project name
  • Environment (id + display name)
  • Current version

If absent, continue — the project may have been created without the plugin. Re-derive env from power.config.json if needed.

Step 1.5 — App ID preflight (first-deploy gate)

Read power.config.json before building anything:

bash
node -e "const c=require('./power.config.json');console.log(c.appId||'MISSING')"
  • Prints a GUID → normal path. Continue to Step 2.

  • Prints MISSING (null, absent, or empty) → this is a first deploy. Say so plainly before doing any work:

    "⚠️ First deploy detected — power.config.json has no appId yet. The app ID is minted by the first push, but it is compiled into the native bundle at build time. So two full build+push cycles are required. I'll run both; the second is not optional."

    Then run Steps 2 → 2.4 → 2.5 → 3 twice. In cycle 2, npm run build and the Step 2.4 native packaging commands must all re-run — the Hermes bundles from cycle 1 have an empty app ID compiled in. Step 2.5 (offline profile gate) may be skipped on cycle 2 only if no schema or profile file changed between the two cycles; if in doubt, re-run it — it is a local, no-network check.

Why two cycles are unavoidable. power-apps push mints the app ID and writes it back to power.config.json, but it refuses to run at all without an existing build — it fails immediately if the configured buildPath (./dist) is absent. So the ID cannot be minted before the first build, and the first build cannot contain the ID.

Why this is so easy to miss. The runtime guard is:

js
Platform.OS !== 'web' && !isDevPlayer && !hasConfiguredValue(powerConfig.appId)

Web is exempt, and so is Dev Player. The Code App, npm run dev, and the browser preview all look perfectly healthy. The failure appears only in the wrapped native app, as a full-screen red "App ID is missing — Push the mobile app to the Power Platform environment, rebuild it, and try again." That is after a base-package wrap, a signed build, and a device install — the most expensive possible place to discover a one-line config gap.

Step 2 — Build

Telemetry checkpoint: build_power_apps_bundle

Print before starting:

"→ Building production web bundle via npm run build (= expo export --platform web). ~30–90 seconds."

First regenerate connectorSchemas.ts so app/_layout.tsx's schemaMap import reflects every connector currently in .power/schemas/. The npm prestart/preandroid/preios hooks cover dev runs, but npm run build does not — if a connector was added since the last npm run dev, the bundled JS would ship a stale schema map. Always regenerate before build:

bash
npm run generate-schemas
npm run build

If package.json has no build script, fall back to:

bash
npx expo export --platform web

(The current template does not define a build script, so this fallback is the normal path for freshly scaffolded apps. Both forms produce the same dist/ web output.)

Known issue — expo export --platform web never exits. The export finishes its work (writes dist/, prints Exported: dist and the asset count) and then hangs indefinitely. Reproduced deterministically across separate runs; observed still alive 2h34m after completing. dist/ is complete and correct when this happens. Suspected cause: the Metro config returned by createPowerAppsMetroConfig (metro.config.js) installs a dev-server middleware internally, which appears to hold an open handle — a web export should not need a dev server. Note the template itself only calls createPowerAppsMetroConfig; the middleware is applied inside @microsoft/power-apps-native-host, not in app code. Not yet root-caused.

Do not wait on the process. Run it detached and poll for the artifact. Per shared-instructions, scratch files stay project-local in .tmp/ — a fixed /tmp/ path would collide across concurrent projects, and a stale log there could satisfy the grep below and falsely report success:

bash
mkdir -p .tmp
rm -f .tmp/expo-web-export.log
npx expo export --platform web > .tmp/expo-web-export.log 2>&1 &
EXPORT_PID=$!
for _ in $(seq 1 90); do
  grep -q "Exported: dist" .tmp/expo-web-export.log 2>/dev/null && break
  sleep 2
done
if ! grep -q "Exported: dist" .tmp/expo-web-export.log 2>/dev/null; then
  echo "web export did not complete in 180s"; tail -30 .tmp/expo-web-export.log; exit 1
fi
test -f dist/index.html || { echo "dist/index.html missing"; exit 1; }
kill "$EXPORT_PID" 2>/dev/null || true
echo "✓ web export complete (process terminated manually — known hang)"

Treat a completed dist/ as success even though the process had to be killed. The Step 2.4 native packaging commands are not affected — both exit 0 cleanly and stage into dist/ via a temp dir, so they do not clear the web build.

If the build fails:

  • TS6133 (unused import) → remove the import and retry once.
  • Other TypeScript errors → report file + line and STOP. Don't deploy a broken build.
  • Metro bundler errors → surface the full stack and STOP.

Verify dist/ exists with index.html before continuing.

Step 2.4 — Native package (Hermes bundle + customer assets)

Print before starting:

"→ Compiling the native Hermes bundle and hash-addressed asset package for iOS and Android. No JavaScript is compiled inside the wrap pipeline — it only consumes these prebuilt files. ~1–3 minutes."

Node version gate (required). The native export crashes on Node < 20.19.4 — it hits util.styleText(['yellow','inverse','bold'], …), which older Node rejects, failing the Metro bundle with a cryptic ERR_INVALID_ARG_VALUE. Check first:

bash
node -e 'const [M,m,p]=process.versions.node.split(".").map(Number); const ok = M>20 || (M===20 && (m>19 || (m===19 && p>=4))); if (!ok) { console.error(`Node ${process.versions.node} is too old; need >= 20.19.4`); process.exit(1); } console.log(`✓ Node ${process.versions.node}`);'

If it exits non-zero, STOP and tell the user to switch (nvm use 20.19.4, or install Node ≥ 20.19.4) and rerun. Do not run the native packaging commands on older Node.

The web build above produces dist/index.html (the hosted Code App). Native wrapped apps additionally need a precompiled Hermes bundle and the customer's images/fonts as hash-addressed asset files, so the wrap pipeline never compiles or downloads JavaScript. Produce both platforms:

bash
npm run bundle:android
npm run bundle:ios

Each command produces that platform's native Hermes bundle and its customer asset package, writing next to dist/index.html:

  • Android: dist/index.android.bundle.hbc (Hermes bytecode) + dist/powerapps-customer-assets-android/ (manifest.json + assets/<fileHash>.<type>)
  • iOS: dist/main.jsbundle.hbc (Hermes bytecode) + dist/powerapps-customer-assets-ios/ (manifest.json + assets/<fileHash>.<type>)

Both platforms are required — the verification below fails if either bundle or either manifest is missing.

These sit alongside index.html under the same container SAS, so the wrap pipeline fetches them as siblings — no RP or connector change is required.

Verify before continuing — STOP on any failure (never push a web-only build for a native-wrapped app):

bash
# Hermes magic bytes on both bundles (expect c61fbc03)
for f in dist/index.android.bundle.hbc dist/main.jsbundle.hbc; do
  test -f "$f" || { echo "MISSING $f"; exit 1; }
  node -e 'const fs=require("fs"),b=Buffer.alloc(4),fd=fs.openSync(process.argv[1],"r");fs.readSync(fd,b,0,4,0);fs.closeSync(fd);process.exit(b.toString("hex")==="c61fbc03"?0:1)' "$f" || { echo "$f is not Hermes bytecode"; exit 1; }
done
# both asset manifests present
test -f dist/powerapps-customer-assets-android/manifest.json || { echo "MISSING android manifest"; exit 1; }
test -f dist/powerapps-customer-assets-ios/manifest.json     || { echo "MISSING ios manifest"; exit 1; }
echo "✓ native package + asset manifests present"

If a native packaging step fails, surface the error and STOP. If the app renders bundled images/fonts, also confirm each manifest.json assets array is non-empty (an empty array means the app doesn't require() any static asset yet).

Step 2.5 — Offline profile coverage gate

Telemetry checkpoint: validate_offline_profile_coverage

This is the final chance to catch schema that never made it into the Mobile Offline Profile before it ships — a table added to the data model but not the profile never syncs to devices, and a new column arrives blank offline. Validate that every schema change is covered before pushing.

Run the local, no-network delta check (.datamodel-manifest.json vs offline-profile.json):

bash
node "${PLUGIN_ROOT}/scripts/offline-profile-delta.js"

Branch on the JSON status (full contract in offline-profile-reconciliation.md):

statusAction
no-manifestConnectors-only app — no Dataverse schema. Continue to Step 3 silently.
no-profileNo offline profile in this project. Print one line: ↷ No offline profile — skipping offline coverage check. Run /setup-offline-profile if you want offline support. Continue to Step 3.
in-syncPrint ✓ Offline profile covers all schema changes. Continue to Step 3.
erroroffline-profile.json is unreadable — the script prints status: error and exits non-zero. Offline coverage can't be validated against a corrupt file, so STOP before pushing: surface the error string and have the user fix offline-profile.json and re-run, or type the deploy without offline override (below) to push anyway.
deltaSTOP before pushing. See below.

On delta — print the uncovered schema, then gate with AskUserQuestion:

⚠ The offline profile is missing schema changes. If you deploy now, these won't be
  available on disconnected devices:

  Tables not in the profile : <missingTables[].logicalName>
  Tables with new columns   : <tablesWithNewColumns[].logicalName (newColumns)>

Options:

  • Update the offline profile now (recommended) — read and execute ${PLUGIN_ROOT}/skills/add-table-to-offline-profile/SKILL.md for each missingTables[] entry (or once with --all-new), then read and execute ${PLUGIN_ROOT}/skills/edit-offline-profile/SKILL.md with --table <t> --columns add:<newColumns> for each tablesWithNewColumns[] entry. Follow the ordering in the reconciliation reference, then re-run the delta check; when it reports in-sync, continue to Step 3.
  • Deploy anyway — requires an explicit override. Wait for the exact phrase deploy without offline (case-insensitive); a bare y/yes is not enough, mirroring the environment-mismatch gate in Step 3. Then continue to Step 3 and note the skipped reconciliation in the Step 4 build-history row.

Do not push until the gate is resolved (reconciled to in-sync, or explicitly overridden).

Step 3 — Deploy

Telemetry checkpoint: push_app_to_power_platform

Resolve and confirm the target environment FIRST. npx power-apps push deploys to the environment configured in power.config.json. Resolve that ID to a Dataverse URL so the user catches drift before pushing.

Run:

bash
ENV_ID=$(node -e "console.log(require('./power.config.json').environmentId)")
node "${PLUGIN_ROOT}/scripts/resolve-environment.js" "$ENV_ID"

From resolve-environment.js capture the Environment URL (e.g. https://contoso.crm.dynamics.com/), Environment ID, and Tenant ID. Cross-check against memory-bank.md / power.config.json:

  • Match → proceed to the confirmation prompt below.
  • Mismatch → STOP. Surface both values side-by-side and ask the user to either (a) update power.config.json by re-running init in the intended app root, or (b) explicitly type override to push to the environment already recorded in power.config.json. Do not proceed on a bare y.
  • Cannot resolve/authenticate → STOP with az login --tenant <env-tenant> instructions, or ask the user to provide the environment URL directly.

Print before starting:

"→ Pushing bundle to Power Platform via npx power-apps push. ~30–60 seconds."

Confirm with the user using the resolved env URL, not just the friendly name:

"Ready to deploy to (<env-url>)? This will update the live app for every user in that environment. Type yes deploy to <env-name> to confirm."

Wait for the exact phrase yes deploy to <env-name> (case-insensitive, env-name matching). A bare y / yes is not enough — too easy to fire on autopilot when the wrong env is active. Then:

bash
npx power-apps push --non-interactive

Capture the app URL from the output if printed.

First-deploy loop-back. If Step 1.5 reported MISSING, re-read the config now:

bash
node -e "const c=require('./power.config.json');console.log(c.appId||'STILL MISSING')"
  • GUID → the app was registered. Go back to Step 2 and run Build → 2.4 → 2.5 → Deploy one more time. The artifacts now sitting in dist/ (and already uploaded to the blob) still have an empty app ID compiled in; without the second cycle the wrapped app fails on-device. Step 2.5 may be skipped on this second pass only if nothing under .datamodel-manifest.json / offline-profile.json changed since cycle 1.
  • STILL MISSING → push did not register the app. STOP and report. Do not proceed to wrap.

On the second pass this check is a no-op, and Step 4 runs as normal.

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

ErrorFix
npx power-apps push auth error, wrong user, or multiple accountsFollow shared-instructions command-failure handling. az login / az account set does not switch the standalone Power Apps CLI account.
Environment mismatchRe-run npx power-apps init -t MobileApp --display-name <name> --environment-id <id> --non-interactive in a fresh/app root for the intended target
npx power-apps push not recognisedRun npm install in the project so @microsoft/power-apps provides the CLI, or install @microsoft/power-apps-cli only as a last-resort prerequisite after user confirmation.

Step 4 — Update memory bank

If memory-bank.md exists, increment the version (v1.0.0 → v1.1.0) and update:

  • Current version
  • Last deployed timestamp
  • App URL (if captured)
  • Append a row to the Build history section: | v1.1.0 | <timestamp> | deploy | success |

Print the summary card:

✅ Deploy — <project-name>
─────────────────────────────────────────────
Version       : <new-version>
Environment   : <env-name>
App URL       : <url or "see make.powerapps.com">
Bundle path   : dist/

Local dev:    npm run dev  (writes .powernative logs for /debug-app)
Re-deploy:    /deploy
List conns:   /list-connections
─────────────────────────────────────────────

Local dev (out of scope for this skill — for reference only)

When the user wants normal Expo iteration with portable monitoring, they can run:

bash
npm run dev          # Metro + QR + .powernative log

This launches Metro, prints a QR code, and writes sanitized output to .powernative/metro-logs/ so /debug-app can reattach after a host/session restart. They can:

  • Scan the QR with the installed native dev client
  • Reload from the native dev-client menu

Do not use React Native Web, browser automation, direct Metro/localhost HTTP probes, or screen-by-screen runtime checks.

If they want to compile a native binary locally, they run the platform-specific native command directly. Local native compile and manual device testing are user-owned and are not deployment gates for this skill.

Reference

Câu hỏi thường gặp

Kỹ năng AI Deploy làm được gì?

Use to deploy, publish, or push an Expo/React Native Power Apps mobile app to a Power Platform tenant.

Vì sao nên dùng Deploy trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Deploy là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Deploy trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/skills/deploy. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Deploy?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Deploy với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Deploy với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Deploy có miễn phí không?

Có. Kỹ năng này được microsoft phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇