Force-link a Power Platform environment to a new pipelines host.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "force-link-environment" skill from askskill: 1. Download https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/power-pages/skills/force-link-environment/SKILL.md 2. Save it as ~/.claude/skills/force-link-environment/SKILL.md 3. Reload skills and tell me it's ready
Please force-link this Power Platform environment to a new Pipelines host. Creating the deploymentenvironments record fails with: this environment is already associated with another pipelines host.
Force-link the environment to the new host and explain that the previous host association will be removed and what that impacts.
I want to migrate a development environment from a Platform Host to a Custom Host. Run force link and warn me about the impact on pipeline access in the old host.
Complete the host migration and clearly note that the action is destructive to the previous host but reversible by force-linking back.
Please switch the target environment from its current Custom Host to another Custom Host and confirm the validation status succeeds.
Relink the environment to the new host and report successful validation or any follow-up verification result.
When creating a deploymentenvironments record fails because the environment is already linked to another host, developers or DevOps engineers can use this skill to force-link it to the target host. It helps restore the Power Platform Pipelines setup flow.
When a team needs to move an environment from a Platform Host to a Custom Host, or between two Custom Hosts, this skill can perform the host association migration. It fits host architecture changes or taking over an existing association.
If an environment is currently tied to another host but a new host needs to manage it, this skill can take over that association. Before use, you should confirm that pipeline access in the previous host will be affected.
The documentation explains how to use force-link-environment to move a development or target environment’s Power Platform Pipelines host association from one host to another. It covers when to use it, such as deploymentenvironments creation failures or planned host migrations, and describes the effects on records and validation state in both the new and previous hosts. It also highlights the destructive impact on previous-host pipeline access, reversibility, and prerequisites like Azure CLI and PAC CLI authentication.
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.
…
It force-associates a development or target environment with a new Power Platform Pipelines host, overriding the previous host association. Under the hood, it calls the documented Dataverse `ManageEnvironmentStamp` action.
The action is destructive to the previous host: makers who used that environment to run pipelines in the old host lose access. The change is reversible by running Force Link again from the previous host.
The docs mention an Azure CLI token for the host environment and an authenticated PAC CLI session; `pac env who` should report an authenticated environment. For more detailed setup or permission requirements, see the source repository.
Run security scans on deployed Power Pages sites and summarize risks clearly.
Set up Power Platform Pipelines for automated Power Pages deployments.
Review and fix Power Pages security headers, CSP, CORS, cookies, and embedding settings.
Run an end-to-end Power Pages security review with a consolidated HTML report.
Test deployed Power Pages sites with browsing, crawling, and API verification.
Integrate Power Automate cloud flows into Power Pages with generated metadata and code.
Check and prepare a usable Power Platform Pipelines host before pipeline runs.
Trigger and monitor Power Platform pipeline deployments for Power Pages solutions.
Configure Power Pages environment variables and deployment settings for multi-environment ALM.
List current Power Platform connections and get IDs for code app connectors.
Add Azure DevOps to Power Apps for work items, bugs, pipelines, and API calls.
Build and deploy an existing Power Pages code site to a target environment.