Skip to main content
Azure OpenAI provides OpenAI’s GPT models through Microsoft’s cloud infrastructure, with enhanced security, compliance certifications (SOC 2, HIPAA, FedRAMP), private networking, and enterprise SLAs. This is the right pick for regulated industries and large-org deployments.

Installation

Environment Setup

Azure OpenAI requires three environment variables:
These come from your Azure OpenAI resource in the Azure Portal.
The model name you pass to Swarms must match your deployment name in Azure, not the underlying model name. Deployments are created in the Azure AI Foundry portal.

Quick Start

Azure deployments use the azure/ prefix followed by your deployment name:

Common Deployment Patterns

The exact name depends on what you named your deployment in Azure.

Tool Use

Tools work the same as on OpenAI directly:

Streaming

Multiple Deployments

Many organizations create separate deployments for different workloads (e.g., one with a 50K TPM quota for production, one with 5K TPM for dev). Swarms can target any of them by deployment name:

Private Networking

If your Azure OpenAI resource is behind a private endpoint, set AZURE_API_BASE to the internal URL and ensure your runtime has network access:
No code changes needed.

Multi-Agent Pipeline

The same composition patterns work on Azure:

Production Defaults

Troubleshooting

InvalidRequestError: Resource not found — your model_name doesn’t match a deployment in your Azure resource. Check the Deployments tab in Azure AI Foundry. AuthenticationError — your AZURE_API_KEY, AZURE_API_BASE, or AZURE_API_VERSION is missing or wrong. All three are required. Rate-limit errors — Azure deployments have hard TPM/RPM quotas set in the portal. Request a quota increase or split traffic across multiple deployments.

Next Steps