Force-links a development or target environment to a Power Platform Pipelines host, overriding any existing association with a previous host. Use when creating a deploymentenvironments record fails with "this environment is already associated with another pipelines host", or when intentionally migrating an environment from one host to another (e.g., Platform Host → Custom Host, or between two Custom Hosts). Calls the documented `ManageEnvironmentStamp` Dataverse action (the API behind the "Force Link" button in the Deployment Pipeline Configuration app). DESTRUCTIVE to the previous host: makers lose access to any pipelines in that host that used this environment. Reversible by running Force Link from the previous host. Use when asked to: "force link environment", "force-link to new host", "switch pipelines host", "environment already associated with another host", "take over pipelines association", "relink environment to host".
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "force-link-environment" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/power-pages/skills/force-link-environment/SKILL.md 2. 保存为 ~/.claude/skills/force-link-environment/SKILL.md 3. 装好后重载技能,告诉我可以用了
Plugin check: Run
node "${CLAUDE_PLUGIN_ROOT}/scripts/check-version.js"— if it outputs a message, show it to the user before proceeding.
Move a dev or target environment's Power Platform Pipelines host association from one host to another. This is the documented remediation when deploymentenvironments create fails with "this environment is already associated with another pipelines host", and also the right tool when intentionally migrating environments between hosts.
Microsoft Learn (ground truth): Using Force Link to associate an environment with a new host
In the target host (the new host the user wants to use):
deploymentenvironments record as the active stamp for the BAP environment.validationstatus flips to Succeeded (200000001).In the previous host (the host the env was previously linked to):
deploymentenvironments row is delinked. Its validationstatus is left stale until refreshed in the previous host's UI.The action is reversible by running Force Link again from the previous host.
Before any Dataverse call, refresh the agent's grounding by fetching the doc above via mcp__plugin_power-pages_microsoft-learn__microsoft_docs_fetch. If the doc has updated behaviors (e.g., new permission requirements, new warning text), surface them to the user before continuing. See ${CLAUDE_PLUGIN_ROOT}/references/alm-docs-grounding.md for the shared pattern.
| # | Phase | Output |
|---|---|---|
| 1 | Prerequisites | Azure CLI token for the host environment; PAC CLI authenticated |
| 1.5 | MCP Learn grounding | Confirmed current behavior of Force Link / ManageEnvironmentStamp |
| 2 | Identify host + dev env | hostEnvUrl, target host's deploymentEnvironmentId, source BAP env GUID |
| 3 | Resolve deploymentenvironments record | Either an existing record on the new host, or a freshly created one |
| 4 | Confirm destructive action | Explicit user consent via AskUserQuestion |
| 5 | Execute Force Link | 204 from ManageEnvironmentStamp + post-validation Succeeded |
| 6 | Write marker + summary | docs/alm/last-force-link.json + human-readable summary |
Create all tasks at Phase 1 start with TaskCreate. Mark each in_progress when starting and completed when done.
Reuse the shared verifier:
node "${CLAUDE_PLUGIN_ROOT}/scripts/lib/verify-alm-prerequisites.js"
Specifically required:
pac env who must report an authenticated environment (for --dev-env auto-discovery).az account show succeeds.ManageEnvironmentStamp returns 403.Fetch the host token from Azure CLI using the host's Dataverse URL as the resource. Reuse getAuthToken from scripts/lib/validation-helpers.js.
Call:
mcp__plugin_power-pages_microsoft-learn__microsoft_docs_fetch(url=
"https://learn.microsoft.com/en-us/power-platform/alm/custom-host-pipelines")
Confirm the "Using Force Link…" section's current warnings before proceeding. If the section now mentions new prerequisites or rollback constraints not covered in this skill, surface them to the user.
…
检查并配置 Power Pages 站点安全响应头,定位风险并指导修复设置。
对 Power Pages 站点执行端到端安全审查,并汇总生成完整 HTML 报告。
用于对已部署的 Power Pages 网站进行运行时浏览、爬取与接口验证测试。
帮助你为 Power Apps 代码应用添加数据源或连接器,并引导到合适操作流程。
为 Power Apps 代码应用接入 Azure DevOps 连接器,便于查询工单、提报缺陷与管理流水线。
帮助你快速搭建 Power Platform 管道,实现 Power Pages 自动化部署。