← All runbooks
microsoft / azure-hosted-copilot-sdk

GitHub Copilot SDK on Azure

Build, deploy, and modify GitHub Copilot SDK applications on A

agent claude-codemodel claude-sonnet-4-6snapshot python312-uveval programmatic7 stepsv1.0.0

Deploy GitHub Copilot SDK on Azure to your jetty.io

One-click installs this runbook into a collection on your Jetty account. You can run it from the Spot dashboard, schedule it, or pipe inputs in via the API.

The shape of the run

7 steps · start to finish.

  1. 0
    Step 0

    Codebase Detection — MANDATORY FIRST CHECK

    CRITICAL: This check MUST run before any other step when an existing codebase is present.

    # Check package.json for Copilot SDK markers
    if [ -f package.json ]; then
      if grep -q '@github/copilot-sdk\|copilot-sdk' package.json; then
        echo "DETECTED: @github/copilot-sdk in package.json — proceeding with this skill"
      fi
    fi
    
    # Scan TypeScript/JavaScript source files for runtime markers
    if grep -r 'CopilotClient\|createSession\|sendAndWait' --include='*.ts' --include='*.js' . 2>/dev/null | grep -q .; then
      echo "DETECTED: CopilotClient or createSession in source files — proceeding with this skill"
    fi
    
    MarkerWhere to check
    @github/copilot-sdkpackage.json dependencies or devDependencies
    copilot-sdkpackage.json name or dependencies
    CopilotClientSource files (.ts, .js)
    createSession + sendAndWaitSource files (.ts, .js)

    If NO markers are found in an existing codebase → route to azure-prepare instead.

    Generic prompts that MUST trigger this skill when markers are detected:

    Prompt patternWhy this skill
    "Deploy this app to Azure"Codebase contains @github/copilot-sdk
    "Add a new feature to this app"Requires SDK-aware implementation patterns
    "Update this app" / "Modify this app"Must preserve SDK integration patterns
    "Ship this to production"Needs copilot-specific infrastructure and token management

  2. 1
    Step 1

    Environment Setup

    for cli in azd docker node npm az; do command -v "$cli" >/dev/null 2>&1 || { echo "ERROR: $cli not installed"; exit 1; } done

  3. 2
    Step 2

    Route

    Determine the action based on the user's intent:

  4. 4
    Step 4

    Model Configuration

    Choose one of three model paths:

  5. 5
    Step 5

    Deploy

    Invoke the sub-skills in order (skip azure-prepare Step 0 routing — scaffolding is already done):

  6. 6
    Step 6

    Iterate on Errors (max 3 rounds)

    If provisioning or deployment fails:

  7. 7
    Step 7

    Write Results

    if [ -f /tmp/scaffold.log ]; then cp /tmp/scaffold.log /app/results/scaffold_log.txt else echo "No scaffold step performed (modify/deploy-existing route)" > /app/results/scaffold_log.txt