Azure OpenAI Setup

Base URL, deployments, and credential management for Azure OpenAI across Brainforge apps (platform, Slack assistant, hubspot-lead-nudge, GitHub Actions).

Policy: East US 2 only. All new Azure OpenAI deployments go on brainforge-openai-eastus2 (East US 2) from here on. Do not create deployments on brainforge-openai (East US) — that resource is legacy and we are deprecating it. Migrate remaining workloads to East US 2 and point every env var at East US 2. See azure-models-for-devs.md for the deploy checklist.


1. Resources

ResourceRegionStatus
brainforge-openai-eastus2East US 2Use this only. All platform, Slack, Codex, GitHub Actions.
brainforge-openaiEast USLegacy — deprecating. No new deployments or usage; migrate to East US 2.

See azure-models-for-devs.md for the full deployment list, deploy-to–East-US-2 checklist, and env vars.


2. Environment Variables (East US 2 only)

Use the East US 2 key and base URL everywhere. Set AZURE_OPENAI_API_KEY to the same value as BRAINFORGE_OPENAI_EASTUS2_API_KEY so no code path uses the old region.

VariablePurposeUsed by
BRAINFORGE_OPENAI_EASTUS2_API_KEYEast US 2 key (primary)Platform, Slack assistant, CopilotKit, GitHub Actions
AZURE_OPENAI_API_KEYSet to East US 2 key (same as above)Platform (Mastra), hubspot-lead-nudge — required; use East US 2 key
AZURE_OPENAI_EASTUS2_BASE_URLEast US 2 base URL, e.g. https://brainforge-openai-eastus2.openai.azure.comSlack assistant, document-council; set all platform *_BASE_URL to this
AZURE_OPENAI_EASTUS2_CHAT_MODELEast US 2 chat deployment (default: gpt-5.2)GitHub Actions document-council workflow
AZURE_OPENAI_EASTUS2_API_VERSIONChat Completions API version (default: 2024-05-01-preview)GitHub Actions document-council workflow
DOCUMENT_COUNCIL_MAX_DOCSMax doc files reviewed per run (default: 3)GitHub Actions document-council workflow
AZURE_RESPONSES_DEPLOYMENTDeployment name for Responses API (default: gpt-5.2)Slack assistant
AZURE_GPT_4o_BASE_URL, AZURE_o4_MINI_BASE_URL, etc.Set all to East US 2 base URLPlatform Mastra

Slack assistant:

  • AZURE_OPENAI_EASTUS2_BASE_URL — e.g. https://brainforge-openai-eastus2.openai.azure.com (required)
  • BRAINFORGE_OPENAI_EASTUS2_API_KEY or AZURE_OPENAI_API_KEY (both should be East US 2 key)

GitHub Actions document-council workflow (Azure-only):

  • Workflow: .github/workflows/document-council-on-pr.yml
  • Required secret: BRAINFORGE_OPENAI_EASTUS2_API_KEY
  • Optional repo variables:
    • AZURE_OPENAI_EASTUS2_BASE_URL (defaults to https://brainforge-openai-eastus2.openai.azure.com)
    • AZURE_OPENAI_EASTUS2_CHAT_MODEL (defaults to gpt-5.2)
    • AZURE_OPENAI_EASTUS2_API_VERSION (defaults to 2024-05-01-preview)
    • DOCUMENT_COUNCIL_MAX_DOCS (defaults to 3)

The workflow intentionally avoids OPENAI_API_KEY and only uses East US 2 Azure credentials.


3. Checking Credits

Azure Sponsorship credits cannot be checked via CLI. Use:


4. Azure CLI Commands

Prerequisites

az login
az version

Check current setup

From repo root:

./apps/platform/scripts/azure-check.sh

Or manually:

az account show --output table
az account list --output table
az group list --output table
az cognitiveservices account list --output table

List deployments

az account set --subscription "1e40d527-4a83-4aa2-86fd-345bac08d96f"
# Canonical (East US 2)
az cognitiveservices account deployment list -g brainforge -n brainforge-openai-eastus2 -o table
# Legacy audit only (East US — deprecating)
az cognitiveservices account deployment list -g brainforge -n brainforge-openai -o table

Create a new deployment

See azure-deployment-create.sh and azure-openai-deployment-options.md.

Example:

./apps/platform/scripts/azure-deployment-create.sh gpt-4o-mini gpt-4o-mini 2024-07-18

5. Credentials (1Password)

Azure OpenAI keys are stored in 1Password vault Brainforge AI Team.

op item list --vault "Brainforge AI Team"
op item get "Azure OpenAI" --vault "Brainforge AI Team"

Use op read "op://Brainforge AI Team/Azure OpenAI/credential" for scripts.


6. References