azure-hosted-copilot-sdk
npx machina-cli add skill microsoft/GitHub-Copilot-for-Azure/azure-hosted-copilot-sdk --openclawGitHub Copilot SDK on Azure
Step 1: Route
| User wants | Action |
|---|---|
| Build new (empty project) | Step 2A (scaffold) |
| Add new SDK service to existing repo | Step 2B (scaffold alongside) |
| Deploy existing SDK app to Azure | Step 2C (add infra to existing SDK app) |
| Add SDK to existing app code | Integrate SDK |
| Use Azure/own model | Step 3 (BYOM config) |
Step 2A: Scaffold New (Greenfield)
azd init --template azure-samples/copilot-sdk-service
Template includes API (Express/TS) + Web UI (React/Vite) + infra (Bicep) + Dockerfiles + token scripts — do NOT recreate. See SDK ref.
Step 2B: Add SDK Service to Existing Repo
User 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.
Step 2C: Deploy Existing SDK App
User already has a working Copilot SDK app and needs Azure infra. See deploy existing ref.
Step 3: Model Configuration
Three model paths (layers on top of 2A/2B):
| Path | Config |
|---|---|
| GitHub default | No model param — SDK picks default |
| GitHub specific | model: "<name>" — use listModels() to discover |
| Azure BYOM | model + provider with bearerToken via DefaultAzureCredential |
See model config ref.
Step 4: Deploy
Invoke azure-prepare (skip its Step 0 routing — scaffolding is done) → azure-validate → azure-deploy in order.
Rules
- Read
AGENTS.mdin user's repo before changes - Docker required (
docker info)
Source
git clone https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/main/plugin/skills/azure-hosted-copilot-sdk/SKILL.mdView on GitHub Overview
This skill helps you scaffold, configure, and deploy GitHub Copilot SDK services on Azure using the official Copilot SDK template. It covers building new projects, adding a Copilot SDK to existing repos, and BYOM/Azure OpenAI model setups with a guided deploy flow.
How This Skill Works
Begin by running azd init --template azure-samples/copilot-sdk-service to generate an API (Express/TS), UI (React/Vite), and infra (Bicep) setup. Then configure the model (GitHub default, a named GitHub model, or Azure BYOM using DefaultAzureCredential) and deploy through the azure-prepare, azure-validate, and azure-deploy steps.
When to Use It
- Scaffold a brand-new Copilot SDK service from scratch using the provided Azure template.
- Add a Copilot SDK service alongside an existing repository and merge the infra.
- Deploy an already-built Copilot SDK app to Azure infrastructure.
- Configure BYOM or Azure OpenAI models (default, named, or BYOM) for the Copilot app.
- Bring your own model and host it with the Copilot SDK service using DefaultAzureCredential.
Quick Start
- Step 1: Run azd init --template azure-samples/copilot-sdk-service to scaffold the Copilot SDK service.
- Step 2: If adding to an existing repo, scaffold alongside and merge the API + infra, updating azure.yaml as needed.
- Step 3: Run azure-prepare → azure-validate → azure-deploy after configuring the model (default, named, or BYOM).
Best Practices
- Read AGENTS.md in the target repository before making changes.
- Ensure Docker is installed and running (docker info) before scaffold and deploy.
- Use DefaultAzureCredential for BYOM model access and secure token handling.
- Keep azure.yaml updated if you add multiple Copilot SDK services to a repo.
- Validate the model configuration by listing models and testing the session creation.
Example Use Cases
- Scaffold a new Copilot SDK service in a fresh repo with azd init --template azure-samples/copilot-sdk-service.
- Add a Copilot SDK service to an existing repo by scaffolding to a temp dir and merging the API + infra.
- Deploy an existing Copilot SDK app to Azure infra using the Step 4 deploy flow (azure-prepare, azure-validate, azure-deploy).
- Configure BYOM by setting model and provider with bearerToken via DefaultAzureCredential for azure openai.
- Discover and select a model via listModels() from GitHub Models API to configure the SDK service.