microsoft/power-platform-skills / plugins/power-pages/skills/force-link-environment
force-link-environment
VerifiedForce-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".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 15.7 KB |
| scripts/validate-force-link.js | script | 2.8 KB |
scripts/validate-force-link.js
View on GitHub#!/usr/bin/env node
// Stop-hook validator for the force-link-environment skill.
// Reads docs/alm/last-force-link.json from the project and verifies the marker
// reflects a completed Force Link. Gracefully exits 0 when no marker exists
// (not a force-link session).
//
// Pass conditions (exit 0):
// - File missing.
// - schemaVersion is 1.
// - hostEnvUrl, deploymentEnvironmentId, validationStatus, forcedAt populated.
// - validationStatus === 200000001 (Succeeded).
//
// Block conditions (exit 2):
// - File present but missing required fields or unsupported schemaVersion.
// - validationStatus === 200000002 (Failed) — Force Link's post-link
// validation didn't succeed; surface to investigation rather than silently
// pass.
'use strict';
const fs = require('fs');
const {
approve,
block,
runValidation,
findProjectRoot,
readDeferralMarker,
} = require('../../../scripts/lib/validation-helpers');
const { almPath } = require('../../../scripts/lib/alm-paths');
const VALIDATION_STATUS_SUCCEEDED = 200000001;
const VALIDATION_STATUS_FAILED = 200000002;
runValidation((cwd) => {
const projectRoot = findProjectRoot(cwd) || cwd;
if (readDeferralMarker(projectRoot)) return approve();
const markerPath = almPath(projectRoot, 'lastForceLink');
if (!fs.existsSync(markerPath)) return approve(); // Not a force-link session.
let marker;
try {
marker = JSON.parse(fs.readFileSync(markerPath, 'utf8'));
} catch {
return block('docs/alm/last-force-link.json exists but could not be parsed as JSON.');
}
if (marker.schemaVersion !== 1) {
return block(`docs/alm/last-force-link.json has unsupported schemaVersion: ${marker.schemaVersion}. Expected 1.`);
}
if (!marker.hostEnvUrl) {
return block('docs/alm/last-force-link.json is missing required field: hostEnvUrl');
}
if (!marker.deploymentEnvironmentId) {
return block('docs/alm/last-force-link.json is missing required field: deploymentEnvironmentId');
}
if (!marker.forcedAt) {
return block('docs/alm/last-force-link.json is missing required field: forcedAt');
}
if (typeof marker.validationStatus !== 'number') {
return block('docs/alm/last-force-link.json is missing required field: validationStatus (number)');
}
if (marker.validationStatus === VALIDATION_STATUS_FAILED) {
return block(
`docs/alm/last-force-link.json reports validationStatus=Failed (${VALIDATION_STATUS_FAILED}). Re-run force-link-environment or investigate the host's environment record.`,
);
}
if (marker.validationStatus !== VALIDATION_STATUS_SUCCEEDED) {
return block(
`docs/alm/last-force-link.json has non-terminal validationStatus=${marker.validationStatus}. Expected Succeeded (${VALIDATION_STATUS_SUCCEEDED}).`,
);
}
return approve();
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |