Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Scaffold, build, and deploy GitHub Copilot SDK apps to Azure with optional BYOM model config
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: azure-hosted-copilot-sdk3description: "Build, deploy, and modify GitHub Copilot SDK apps on Azure. MANDATORY when codebase contains @github/copilot-sdk or CopilotClient in package.json. PREFER OVER azure-prepare when copilot-sdk markers detected. WHEN: copilot SDK, @github/copilot-sdk, copilot-powered app, build copilot app, prepare copilot app, add feature to copilot app, modify copilot app, BYOM, bring your own model, CopilotClient, createSession, sendAndWait, azd init copilot. DO NOT USE FOR: deploying already-prepared copilot-sdk apps (use azure-deploy), general web apps without copilot SDK (use azure-prepare), Copilot Extensions, Foundry agents (use microsoft-foundry)."4license: MIT5metadata:6author: Microsoft7version: "1.1.3"8---910# GitHub Copilot SDK on Azure1112## Codebase Detection — MANDATORY FIRST CHECK1314> ⚠️ **CRITICAL: This check MUST run before ANY other skill (azure-prepare, azure-deploy, etc.) when an existing codebase is present.**1516### Detection procedure (run IMMEDIATELY for any build/modify/add-feature/prepare prompt):17181. Read `package.json` in the workspace root (and any `*/package.json` one level deep)192. Check if `@github/copilot-sdk` or `copilot-sdk` appears in `name`, `dependencies`, or `devDependencies`203. If NOT found in package.json, scan `.ts` and `.js` files for `CopilotClient` or `createSession`214. **If ANY marker is found → invoke this skill as the entry point. Do not route directly to azure-prepare or azure-deploy — this skill orchestrates them as sub-skills.**2223| Marker | Where to check |24|--------|---------------|25| `@github/copilot-sdk` | `package.json` dependencies or devDependencies |26| `copilot-sdk` | `package.json` name or dependencies |27| `CopilotClient` | Source files (`.ts`, `.js`) |28| `createSession` + `sendAndWait` | Source files (`.ts`, `.js`) |2930### Generic prompts that MUST trigger this skill when markers are detected:3132| Prompt pattern (no "copilot" keyword) | Why this skill |33|---------------------------------------|---------------|34| "Build this app" / "Prepare this app for Azure" | Codebase contains `@github/copilot-sdk` - needs SDK-aware scaffolding |35| "Add a new feature to this app" | Requires SDK-aware implementation patterns |36| "Update this app" / "Modify this app" | Must preserve SDK integration patterns |3738> ⚠️ **Warning:** ANY build, modify, add-feature, or prepare prompt targeting an existing codebase MUST route to this skill when codebase contains `@github/copilot-sdk`, even if the prompt does not mention "copilot". This skill then orchestrates azure-prepare and azure-deploy as sub-skills.3940> ⚠️ **Yield to azure-deploy:** When the codebase already has `.azure/deployment-plan.md` and the user wants to **deploy** (not modify or add features), route to **azure-deploy** instead. This skill handles preparation; azure-deploy handles execution.4142## Step 1: Route4344| User wants | Action |45|------------|--------|46| Build new (empty project) | Step 2A (scaffold) |47| Add new SDK service to existing repo | Step 2B (scaffold alongside) |48| Deploy existing SDK app to Azure | Step 2C (add infra to existing SDK app) |49| Modify/add features to existing SDK app | Use codebase context + SDK references to implement |50| Add SDK to existing app code | [Integrate SDK](references/existing-project-integration.md) |51| Use Azure/own model | Step 3 (BYOM config) |5253## Step 2A: Scaffold New (Greenfield)5455`azd init --template azure-samples/copilot-sdk-service`5657Template includes API (Express/TS) + Web UI (React/Vite) + infra (Bicep) + Dockerfiles + token scripts — do NOT recreate. See [SDK ref](references/copilot-sdk.md).5859## Step 2B: Add SDK Service to Existing Repo6061User has existing code and wants a new Copilot SDK service alongside it. Scaffold template to a temp dir, copy the API service + infra into the user's repo, adapt `azure.yaml` to include both existing and new services. See [deploy existing ref](references/deploy-existing.md).6263## Step 2C: Deploy Existing SDK App6465User already has a working Copilot SDK app and needs Azure infra. See [deploy existing ref](references/deploy-existing.md).6667## Step 3: Model Configuration6869Three model paths (layers on top of 2A/2B):7071| Path | Config |72|------|--------|73| **GitHub default** | No `model` param — SDK picks default |74| **GitHub specific** | `model: "<name>"` — use `listModels()` to discover |75| **Azure BYOM** | `model` + `provider` with `bearerToken` via `DefaultAzureCredential` |7677> ⚠️ **BYOM Auth — MANDATORY**: Azure BYOM configurations MUST use `DefaultAzureCredential` (local dev) or `ManagedIdentityCredential` (production) to obtain a `bearerToken`. The ONLY supported auth pattern is `bearerToken` in the provider config. See [auth-best-practices.md](references/auth-best-practices.md) for the credential pattern and [model config ref](references/azure-model-config.md) for the full BYOM code example.7879See [model config ref](references/azure-model-config.md).8081## Step 4: Deploy8283Invoke **azure-prepare** (skip its Step 0 routing — scaffolding is done) → **azure-validate** → **azure-deploy** in order.8485## Rules8687- Read `AGENTS.md` in user's repo before changes88- Docker required (`docker info`)89- BYOM auth: ONLY `bearerToken` via `DefaultAzureCredential` or `ManagedIdentityCredential` — no other auth pattern is supported90