Robertjam954/multimodal_rag_application / .claude/skills/azure-hosted-copilot-sdk
azure-hosted-copilot-sdk
VerifiedBuild, 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).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.2 KB |
| references/auth-best-practices.md | markdown | 6.1 KB |
| references/azure-model-config.md | markdown | 4.5 KB |
| references/copilot-sdk.md | markdown | 3.7 KB |
| references/deploy-existing.md | markdown | 3.0 KB |
| references/existing-project-integration.md | markdown | 2.6 KB |
references/deploy-existing.md
View on GitHub# Deploy Existing Copilot SDK App
Adapt a user's existing Copilot SDK app for Azure by scaffolding the template to a temp directory, then copying infra into the user's project.
> ⚠️ **Warning:** Do NOT run `azd init` inside the user's project — it overwrites existing files. Always scaffold to a temp dir.
## 1. Scaffold Template to Temp Dir
```bash
azd init --template azure-samples/copilot-sdk-service --cwd <temp-dir>
```
This gives you the working infra, scripts, and Dockerfiles without touching the user's project.
## 2. Copy Infra Into User's Project
From the temp scaffold, copy these into the user's project root:
| Source | Purpose |
|--------|---------|
| `infra/` | Bicep modules (AVM-based), main.bicep, resources.bicep |
| `scripts/get-github-token.mjs` | azd hook — gets `GITHUB_TOKEN` via `gh auth token` |
| `azure.yaml` | Deployment manifest (will need editing) |
> ⚠️ Copy `scripts/get-github-token.mjs` exactly — do NOT rewrite it.
## 3. Adapt azure.yaml
Edit the copied `azure.yaml` to point at the user's app:
- Set `services.api.project` to the user's API directory
- Set `services.api.language` to the detected language
- Set `services.api.ports` to the user's port
- Add a `web` service if the app has a frontend
- Keep the `hooks` section unchanged (preprovision + prerun call the token script)
## 4. GitHub Token Flow
The template's token flow (already in the copied files):
1. **`scripts/get-github-token.mjs`** — runs `gh auth token`, verifies `copilot` scope, stores via `azd env set`
2. **`azure.yaml` hooks** — `preprovision` and `prerun` call the token script
3. **Bicep `@secure() param githubToken`** — azd auto-maps the env var
4. **Key Vault** — stores secret; Managed Identity gets `Key Vault Secrets User` role
## 5. Dockerfile
If the user has no Dockerfile, copy the template's Dockerfile for the detected language from the temp dir and adapt entry point, build steps, and port.
## 6. BYOM Infrastructure (Azure Model)
If the user wants Azure BYOM, add to the copied Bicep:
| Resource | Purpose |
|----------|---------|
| Azure OpenAI / AI Services account | Hosts model deployments |
| Role assignment | `Cognitive Services OpenAI User` for Managed Identity |
Add env vars to Container App: `AZURE_OPENAI_ENDPOINT`, `MODEL_PROVIDER=azure`, `MODEL_NAME=<deployment>`, `AZURE_CLIENT_ID=<managed-identity-client-id>`.
> ⚠️ **Warning:** The template's `main.parameters.json` defaults to `gpt-4o` which does NOT support BYOM (encrypted content). Change the default to an o-series or gpt-5 family model.
See [Azure Model Configuration](azure-model-config.md) for provider config and auth pattern.
## 7. Errors
| Error | Fix |
|-------|-----|
| `gh` not installed | User must install GitHub CLI |
| Missing `copilot` scope | Run `gh auth refresh --scopes copilot` |
| Key Vault soft-delete conflict | Use a unique vault name or purge the old one |
| Token not injected | Verify `azure.yaml` hooks and `scripts/get-github-token.mjs` exist |
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 |