AGENT SKILL

Microsoft App 共享链接管理

share-link

通过 `ms app share link create`、`ms app share link list` 和 `ms app share link revoke` 管理 Microsoft App 的租户级共享链接。适用于希望通过 URL(而非指定主体)来分发应用访问权限的场景。

License 许可
MIT
最近更新
2026-11-06
Stars
★ 36
Forks
12

01 前言 Front Matter

name
share-link
description
Manages tenant-wide share links for a Microsoft App via `ms app share link create`, `ms app share link list`, and `ms app share link revoke`. Use when you want to distribute app access via a URL instead of named principals.
allowed-tools
Read Grep Glob Bash AskUserQuestion

03 SKILL.md 正文

? Shared Instructions: shared-instructions.md — Cross-cutting concerns.

Share Link

Manages tenant-wide JIT-redemption links for a Microsoft App. The first time a recipient opens a share link they are automatically granted the Microsoft App Reader role at the app scope — no explicit principal list required.

Three sub-commands:

Command Purpose
ms app share link create Generate a new share link URL
ms app share link list List all active share links
ms app share link revoke Revoke a link by ID (removes redeemers' access)

Note: Share links are for distributing play access tenant-wide. For granting named users play or edit access, use /share instead.

Workflow

  1. Memory Bank → 2. Verify Project + Env → 3. Mode → 4. Run → 5. Surface Result

Step 1: Check Memory Bank

Read memory-bank.md per shared-instructions.md for the app's environment/app identifiers, if recorded.

Step 2: Verify Project + Env

test -f ms.config.json || { echo "Not in a Microsoft App workspace."; exit 1; }
BIN=ms
$BIN auth status                                         # must report the expected UPN

Both --app and --environment-id can be supplied explicitly to run from outside a project directory. When ms.config.json is present its appId and environmentId are used automatically.

Step 3: Mode

Ask the user which operation they want if not already clear from context:

  • create — generate a new share link.
  • list — show all active share links.
  • revoke — delete a share link by ID (also removes access for past redeemers).

Step 4: Run

Create

$BIN app share link create

Flags:

Flag Required Description
--app No App name override. Defaults to appId in ms.config.json.
--environment-id / -e No Environment ID override. Defaults to ms.config.json.
--json No Machine-readable envelope: { success, appName, appShareLinkId, shareLinkUrl }.

On success the CLI prints the share link URL on its own line so it copies cleanly. Capture and present that URL to the user:

Share link created for 'my-app' (id: a3f1). Anyone in your tenant who opens
this link will be granted Microsoft App Reader access. Share URL:
https://apps.powerapps.com/play/e/<env-id>/app/<app-guid>?shareLink=a3f1...

List

$BIN app share link list

Flags: same --app / --environment-id / --json as create. No additional flags.

Human-readable output is a table with columns: LINK ID, ROLE, REDEEMERS, CREATED BY. The URL is intentionally omitted from the table — use --json if the full URL is needed.

Present the table to the user. If the list is empty, tell them no share links are currently active.

Revoke

Before running, show the user what will be revoked:

"About to revoke share link <link-id> for app <app-name>. Anyone who has not yet redeemed it will lose access; users who already redeemed it will have their Microsoft App Reader role removed. Continue?"

Wait for explicit yes. Never auto-proceed — this removes access for all past redeemers.

$BIN app share link revoke --link-id <link-id>

Flags:

Flag Required Description
--link-id / -l Yes The 4-char lowercase hex link ID returned at creation time (e.g. a3f1).
--force / -f No Skip the CLI's own confirmation prompt. Always pass --force when running non-interactively because the agent has already asked for confirmation in the previous step.
--app No App name override.
--environment-id / -e No Environment ID override.
--json No Envelope: { success, appName, linkId, existed: boolean }.

If the user has already confirmed, pass --force to avoid a double-prompt:

$BIN app share link revoke --link-id a3f1 --force

Step 5: Surface Result

Create: Print the full share URL. Remind the user this grants read-only app access to anyone in the tenant who opens it, and that they can revoke it at any time with ms app share link revoke --link-id <id>.

List: Present the table. Offer to create or revoke links from here if appropriate.

Revoke:

  • existed: true (or non-JSON success): confirm the link is gone.
  • existed: false / 404 AppShareLinkNotFound warning: the link ID was not found — treat as a clean no-op and tell the user.

Edge Cases

Situation Action
User doesn't have the link ID for revoke Run ms app share link list first to get the ID, then proceed to revoke.
User wants to revoke all links at once Run ms app share link list --json, extract all appShareLinkId values, confirm once with the full list, then revoke --force each ID in sequence.
ms app share link revoke warns link not found Not an error — the link was already gone. Tell the user and continue.
Hard error (auth / app-not-found / non-zero exit) Surface verbatim and STOP. Do not retry.
User is outside a project directory Pass --app <name> and --environment-id <id> explicitly. Both flags are optional in non-interactive mode when ms.config.json is present.

04 同仓库更多 Skills

microsoft
microsoft/managed-apps

Microsoft 托管应用状态与附件管理

state

使用 `ms project state` CLI schema 命令和生成的 TypeScript 客户端,存储与查询 Microsoft 托管应用的内置状态和文件附件。首先,在用户登录 CLI 后运行 `ms feature status --name state --json`;如果 `feature.enabled` 不为 `true`,则推荐替代的连接器或数据源。

软件开发工程师低代码应用开发
★ 36
microsoft
microsoft/managed-apps

Microsoft 应用共享与访问控制

share

通过 `ms app share` / `ms app unshare` 与用户共享(或取消共享)Microsoft 应用。在需要更新应用访问控制时使用。

IT 管理员身份与访问管理
★ 36
microsoft
microsoft/managed-apps

Microsoft App 浏览器预览

play

通过 `ms app play` 在浏览器中打开 Microsoft App。适用于打开已部署的线上版本或云端托管的预览版本(主分支或特定提交 SHA),而无需启动本地开发服务器。

软件开发工程师开发环境与工具链管理
★ 36
microsoft
microsoft/managed-apps

可用连接器列表查询

list-connectors

列出当前活动环境中可用的连接器——包括每个连接器是被组织策略允许还是阻止——以及已接入 Microsoft App 的连接绑定数据源。适用于在添加数据源之前发现可用的连接器及其操作。

软件开发工程师应用连接器集成
★ 36
microsoft
microsoft/managed-apps

Microsoft 应用列表查询

list-apps

通过 `ms app list --json` 以及可选的 `ms app show --json` 发现活动环境中的受管理应用。在列出或定位应用时使用。

软件开发工程师Microsoft 应用生命周期管理
★ 36
microsoft
microsoft/managed-apps

Microsoft 应用本地运行

dev

通过 `ms app dev` 在本地运行 Microsoft 应用并支持热重载。在开始或重启本地开发、展示 App Player URL 时使用。

软件开发工程师Microsoft 应用生命周期管理
★ 36