Skip to content

Run OpenCode inside a Azure DevOps Pipeline #3885

Closed

Description

@Eckii24

Question

We currently try to create a Azure DevOps pipeline, which takes a prompt and a repository, executes opencode with the prompt and commits and pushes all made changes.

When I execute this it stuck when calling opencode:

Executing OpenCode with prompt: 'hi'
Using model: azure/gpt-5-mini

┌  Credentials ~/.local/share/opencode/auth.json
│
└  0 credentials

┌  Environment
│
●  Azure AZURE_RESOURCE_NAME
│
●  Azure AZURE_API_KEY
│
└  2 environment variables

INFO  2025-11-04T10:36:49 +364ms service=default version=1.0.20 args=["run","--model","azure/gpt-5-mini","--print-logs","--log-level","DEBUG","hi"] opencode

It does not execute or log something else than this.

Does anybody have an idea, what the issue might be here?

My pipeline looks something like this:

trigger:
- none

parameters:
  - name: repositoryName
    displayName: 'Repository name to checkout'
    type: string
    default: '<repoName>'
  - name: prompt
    displayName: 'Prompt to execute with OpenCode'
    type: string
    default: ''
  - name: model
    displayName: 'Model to use'
    type: string
    default: 'gpt-5-mini'

steps:
# Install OpenCode
- task: PowerShell@2
  displayName: 'Install OpenCode'
  inputs:
    targetType: inline
    script: |
      Write-Host "Installing OpenCode..."
      curl -fsSL https://opencode.ai/install | bash
      
      $opencodeBinary = Join-Path "$env:HOME" ".opencode/bin"
      $env:PATH = "$env:PATH:$opencodeBinary"

      opencode --version

# Checkout repository and execute OpenCode
- task: PowerShell@2
  displayName: 'Execute OpenCode on Repository'
  inputs:
    targetType: inline
    script: |
      [...] # checkout repo and cd into it
      
      # Prepare model with azure prefix if not already present
      $rawModel = "${{ parameters.model }}"
      if ($rawModel -like "azure/*") {
        $modelToUse = $rawModel
      }
      else {
        $modelToUse = "azure/$rawModel"
      }

      Write-Host "Executing OpenCode with prompt: '${{ parameters.prompt }}'"
      Write-Host "Using model: $modelToUse"
      
      # Execute OpenCode run command with the provided prompt and model
      $opencodeBinary = Join-Path "$env:HOME" ".opencode/bin"
      $env:PATH = "$env:PATH:$opencodeBinary"

      opencode auth list

      opencode run --model "$modelToUse" --print-logs --log-level "DEBUG" "${{ parameters.prompt }}"
      
  env:
    AZURE_API_KEY: $(chatgpt-key)
    AZURE_RESOURCE_NAME: $(ChatGpt.Name)

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 4, 2025
  2. github-actions commented on Nov 4, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. Eckii24 commented on Nov 4, 2025

    @Eckii24
    Author

    Issue is most probably related to:

    ERROR: unexpected status 404 Not Found: {"error":{"code":"NotFound","message":"Azure OpenAI Responses API is not enabled in this region. Please check https://aka.ms/aoai/responsesapi/availability"}}

  4. sschuetz2bit commented on Jan 27, 2026

    @sschuetz2bit

    @Eckii24 How did you resolve that or got the logs?
    i have exactly the same issue, that it does not execute nor logs

  5. Eckii24 commented on Jan 27, 2026

    @Eckii24
    Author

    @sschuetz2bit we used codex 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    opentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions