activate-site
The activate-site skill provisions a new Power Pages website in a Power Platform environment by calling the Power Platform REST API. Use this skill after creating a Power Pages code site with the create-site skill to complete the site provisioning workflow. The skill verifies PAC CLI and Azure CLI authentication, gathers activation parameters including site name and subdomain, confirms all settings with the user, executes the activation API request, polls for provisioning completion, and displays the resulting site URL.
git clone --depth 1 https://github.com/microsoft/power-platform-skills /tmp/activate-site && cp -r /tmp/activate-site/plugins/power-pages/skills/activate-site ~/.claude/skills/activate-siteSKILL.md
> **Plugin check**: Run `node "${CLAUDE_PLUGIN_ROOT}/scripts/check-version.js"` — if it outputs a message, show it to the user before proceeding.
# Activate Power Pages Site
Provision a new Power Pages website in a Power Platform environment via the Power Platform REST API.
> **Prerequisite:** This skill expects an existing Power Pages code site created via `/create-site`. Run that skill first if the site does not exist yet.
## Core Principles
- **Cloud-aware URL resolution** — Never hardcode API base URLs or site URL domains. Always derive them from the Cloud value returned by `pac auth who`.
- **Token handling** — Scripts acquire and refresh Azure CLI tokens internally. The agent only needs to verify the user is logged in to Azure CLI.
- **Confirm before mutating** — Always present the full activation parameters to the user and get explicit approval before POSTing to the websites API.
**Initial request:** $ARGUMENTS
## Workflow
1. **Phase 1: Verify Prerequisites** — PAC CLI auth + Azure CLI login + activation status check
2. **Phase 2: Gather Parameters** — Site name, subdomain, website record ID
3. **Phase 3: Confirm** — Present all parameters to user for approval
4. **Phase 4: Activate & Poll** — Run activation script (POST + poll provisioning status)
5. **Phase 5: Present Summary** — Show site URL, suggest next steps
---
## Phase 1: Verify Prerequisites
**Goal:** Ensure PAC CLI is installed and authenticated, and verify the user is logged in to Azure CLI (scripts handle token acquisition internally).
### Actions
#### 1.1 Verify PAC CLI
Run `pac help` to check if the PAC CLI is installed and available on the system PATH.
```bash
pac help
```
**If the command fails** (command not found / not recognized):
1. Tell the user: "PAC CLI is not installed. You can install it by running:"
```bash
dotnet tool install --global Microsoft.PowerApps.CLI.Tool
```
2. If `dotnet` is also not available, direct the user to <https://aka.ms/PowerPlatformCLI> for full installation instructions.
3. After installation, verify by running `pac help` again.
#### 1.2 Check Authentication
Run `pac auth who` to check current authentication status.
```bash
pac auth who
```
**If authenticated**: Extract these values from the output:
- **Environment ID** — the GUID after `Environment ID:`
- **Organization ID** — the GUID after `Organization ID:` (this is the Dataverse org ID)
- **Cloud** — the value after `Cloud:` (e.g., `Public`, `UsGov`, `UsGovHigh`, `UsGovDod`, `China`)
**If not authenticated**: Follow the same authentication flow as `deploy-site` — ask the user for their environment URL and run `pac auth create --environment "<URL>"`.
#### 1.3 Verify Azure CLI Login
Verify the user is logged in to Azure CLI (the activation scripts acquire tokens internally):
```bash
az account show
```
**If `az` is not installed or not logged in**: Instruct the user to install Azure CLI and run `az login --allow-no-subscriptions` (this form works whether or not the user has an Azure subscription — the activation flow only needs an AAD token).
#### 1.4 Check If Already Activated
Before gathering parameters, check whether the site is already activated by running the shared activation status script:
```bash
node "${CLAUDE_PLUGIN_ROOT}/scripts/check-activation-status.js" --projectRoot "<PROJECT_ROOT>"
```
Where `<PROJECT_ROOT>` is the directory containing `powerpages.config.json` or `.powerpages-site` folder.
Evaluate the JSON result:
- **If `activated` is `true`**: Inform the user their site is already activated at `websiteUrl`. Suggest next steps (Phase 5.3) and stop — do NOT proceed to Phase 2.
- **If `activated` is `false`**: Proceed to Phase 2.
- **If `error` is present**: Proceed to Phase 2 (do not block the activation flow).
### Output
- PAC CLI installed and authenticated
- Environment ID, Organization ID, and Cloud value extracted
- Azure CLI login confirmed
- Activation status checked (already activated → stop early, not activated → continue)
---
## Phase 2: Gather Parameters
**Goal:** Determine the site name, generate or accept a subdomain, and look up the website record ID needed for the activation API call.
### Actions
#### 2.1 Read Site Name
Look for `powerpages.config.json` in the current directory or one level of subdirectories using `Glob`:
```text
**/powerpages.config.json
```
Read the file and extract the `siteName` field. If not found, ask the user for the site name using `AskUserQuestion`.
#### 2.2 Generate Subdomain Suggestion
> **CRITICAL — This step is MANDATORY. You MUST ask the user about the subdomain before proceeding. Do NOT skip this step or auto-select a subdomain without user input.**
Run the subdomain generator script to create a random suggestion:
```bash
node "${CLAUDE_PLUGIN_ROOT}/skills/activate-site/scripts/generate-subdomain.js"
```
This outputs a string like `site-a3f2b1`. Resolve the correct site URL domain from the **Cloud** value obtained in Phase 1.2:
| Cloud | Site URL Domain |
|---|---|
| `Public` | `powerappsportals.com` |
| `UsGov` | `powerappsportals.us` |
| `UsGovHigh` | `high.powerappsportals.us` |
| `UsGovDod` | `appsplatform.us` |
| `China` | `powerappsportals.cn` |
<!-- gate: activate-site:2.2.subdomain | category=plan | cancel-leaves=nothing -->
> 🚦 **Gate (plan · activate-site:2.2.subdomain):** Confirm or override the generated subdomain. Subdomain is part of the resulting site URL; Cancel exits before any provisioning call.
Present the generated subdomain to the user and ask them to accept or enter their own using `AskUserQuestion`:
| Question | Header | Options |
|----------|--------|---------|
| Your site subdomain will be: **`<suggestion>`** (full URL: `https://<suggestion>.<siteUrlDomain>`). Would you like to use this subdomain or enter your own? | Subdomain | Use `<suggestion>` (Recommended), Enter a custom subdomain |
**If custom**: The user provides their own subdomain via "Other" free text input. ValidateGuide the user to add a data source, connection, or API connector to a Canvas App via Power Apps Studio, then verify and continue. USE WHEN the user asks to add a data source, add a connection, add an API, add a connector, connect to SharePoint / Dataverse / SQL / Excel / OneDrive / Teams / Office 365, or any similar request to make new data available to the app. DO NOT USE WHEN the user is asking to list or describe existing data sources — call list_data_sources or list_apis directly instead.
Creates or edits a Power Apps Canvas App through the Canvas Authoring MCP coauthoring session. Handles new app generation from requirements, simple inline edits, and complex multi-screen changes with parallel screen builders. Triggers on requests to create, build, generate, modify, update, change, or edit a Canvas App or .pa.yaml files.
Configure the Canvas Authoring MCP server for the current coauthoring session. USE WHEN "configure MCP", "set up MCP server", "MCP not working", "connect Canvas Apps MCP", "canvas-authoring not available", "MCP not configured", "set up canvas apps". DO NOT USE WHEN prerequisites are missing — direct the user to install .NET 10 SDK first.
[DEPRECATED — use canvas-app instead] Generate a complete Power Apps canvas app.
>
Adds Azure DevOps connector to a Power Apps code app. Use when querying work items, creating bugs, managing pipelines, or making ADO API calls.
Adds any Power Platform connector to a Power Apps code app. Generic fallback for connectors not covered by a specific skill.
Adds a data source or connector to a Power Apps code app. Asks what the user wants to accomplish and routes to the appropriate specialized skill.