← All runbooks
microsoft / azure-ai

Azure AI Services

This runbook guides an agent through working with A

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

Deploy Azure AI Services 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. 1
    Step 1

    Environment Setup

    Verify the Azure environment and determine which invocation method to use (MCP vs. CLI).

    echo "=== AZURE AI SERVICES SETUP ==="
    
    # Check if Azure MCP is available
    if command -v mcp >/dev/null 2>&1; then
      echo "MCP available — will prefer azure__search / azure__speech tools"
      USE_MCP=true
    else
      echo "MCP not available — will use Azure CLI fallback"
      USE_MCP=false
    fi
    
    # Verify az CLI is installed (needed as fallback or for management tasks)
    command -v az >/dev/null 2>&1 || { echo "WARNING: az CLI not found. Install via: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash"; }
    
    # Verify login state
    az account show --query "{subscription:id, name:name}" -o json 2>/dev/null || {
      echo "Not logged in to Azure. Run: az login"
      exit 1
    }
    
    # Create output directory
    mkdir -p /app/results
    
    echo "Setup complete."
    

    If the environment is not authenticated, abort and instruct the user to run az login or configure a service principal.


  2. 2
    Step 2

    Select Service and Verify Resource Exists

    Based on the `azure_service` parameter, confirm the target resource exists and is accessible.

  3. 3
    Step 3

    Invoke the Azure AI Service

    Choose the appropriate invocation path based on the selected service and available tools.

  4. 4
    Step 4

    Iterate on Errors (max 3 rounds)

    If Step 3 fails or returns unexpected results:

  5. 5
    Step 5

    Validate Output

    Confirm the service returned meaningful results before writing the summary.

  6. 6
    Step 6

    Write Commands Log

    Document all MCP tool calls and CLI commands executed during this run.

  7. 7
    Step 7

    Final Checklist (MANDATORY — do not skip)

    echo "=== FINAL OUTPUT VERIFICATION ===" RESULTS_DIR="/app/results" for f in \ "$RESULTS_DIR/summary.md" \