Skip to main content
Azure OpenAI Service provides enterprise-grade access to OpenAI models through Microsoft Azure.

Prerequisites

  1. Azure subscription with access to Azure OpenAI Service
  2. Deployed model in your Azure OpenAI resource
  3. API key from your Azure OpenAI resource

Quick Setup

1. Set Your API Key

Add your Azure OpenAI API key to your .env file:
AZURE_OPENAI_API_KEY="your-azure-openai-api-key"

2. Configure the Base URL

Set azureBaseURL in your .taskmaster/config.json under the global section:
{
  "global": {
    "azureBaseURL": "https://your-resource.openai.azure.com/openai"
  }
}
Or use the CLI:
task-master models --set-azure-base-url "https://your-resource.openai.azure.com/openai"
Task Master automatically appends /openai to your base URL if needed.

3. Set Azure as Your Provider

task-master models --set-main azure:gpt-4o

Supported Models

Task Master supports Azure OpenAI models that use the Chat Completions API:
ModelNotes
gpt-4oRecommended for most use cases
gpt-4o-miniCost-effective option
gpt-4-1GPT-4 Turbo
The modelId should match your Azure deployment name exactly. Azure deployment names are case-sensitive.

Configuration Examples

Basic Configuration

{
  "models": {
    "main": {
      "provider": "azure",
      "modelId": "gpt-4o",
      "maxTokens": 16384,
      "temperature": 0.2
    }
  },
  "global": {
    "azureBaseURL": "https://my-resource.openai.azure.com/openai"
  }
}

Role-Specific Base URLs

You can set different base URLs per role if you have deployments in different regions:
{
  "models": {
    "main": {
      "provider": "azure",
      "modelId": "gpt-4o",
      "baseURL": "https://us-east-resource.openai.azure.com/openai",
      "maxTokens": 16384
    },
    "fallback": {
      "provider": "azure",
      "modelId": "gpt-4o-mini",
      "baseURL": "https://eu-west-resource.openai.azure.com/openai",
      "maxTokens": 16384
    }
  }
}

MCP Server Configuration

For Claude Code integration, include your Azure configuration in .mcp.json:
{
  "mcpServers": {
    "task-master-ai": {
      "command": "npx",
      "args": ["-y", "task-master-ai"],
      "env": {
        "AZURE_OPENAI_API_KEY": "your-azure-key-here"
      }
    }
  }
}

Troubleshooting

”Azure endpoint URL is required”

Make sure you’ve set either:
  • global.azureBaseURL in config
  • models.[role].baseURL for the specific role

”Invalid API key”

Verify your AZURE_OPENAI_API_KEY is correct and has access to the deployment.

”Resource not found” (404)

  1. Ensure the modelId matches your Azure deployment name exactly
  2. Verify your base URL format is correct (should be https://your-resource.openai.azure.com)

Getting Your Azure Credentials

Azure Portal

  1. Go to Azure Portal
  2. Navigate to your Azure OpenAI resource
  3. Under Keys and Endpoint, copy:
    • One of the API keys
    • The endpoint URL

Creating a Deployment

  1. In your Azure OpenAI resource, go to Model deployments
  2. Click Manage Deployments to open Azure AI Studio
  3. Create a new deployment and note the deployment name - this is your modelId