What is Azure OpenAI, and how is it different from OpenAI's own API?
OpenAI's models run by Microsoft inside Azure, now part of Microsoft Foundry. Same models and SDK as OpenAI's API, but your data stays with Microsoft, under your Azure agreement.
beginner · Also called Azure OpenAI Service, Azure OpenAI in Foundry Models
OpenAI's models can be reached 2 ways: from OpenAI, or from Microsoft's Azure. Azure OpenAI is the second. The model is the same; who runs it, where your data goes and which contract covers it are not.
What changes when Microsoft runs it
- Who sees the data. Microsoft hosts the models in Azure and, by its own documentation, prompts and answers are not available to OpenAI and are not used to train models.
- Sign-in. Calls can be signed with Microsoft Entra ID, the company's existing identities, instead of a shared API key.
- Networking. Traffic can stay on a private network in Azure.
- Where it runs. A deployment can be global, limited to a data zone (US, EU or Asia Pacific), or one region, and stored data stays in the chosen geography.
- The agreement. It is covered by the company's Microsoft agreement, which often already has data protection terms signed.
Deployments, not model names
On Azure, you first deploy a model in your resource and give the deployment a name. Code then asks for the deployment, not the model:
from openai import OpenAI
client = OpenAI(
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
api_key="...", # or an Entra ID token provider
)
response = client.responses.create(model="my-gpt-deployment", input="Hello")
This is the v1 API: the plain OpenAI SDK with a different address, and no dated api-version. Older code using AzureOpenAI(...) with an api_version still works.
Capacity
Capacity is a quota in tokens per minute, per subscription, region, model and deployment type, which you divide between deployments. Requests per minute follow from it. As on OpenAI, the max_tokens you ask for counts toward the limitRate LimitThe most an API lets you send in a period, counted in requests and tokens per minute. Past it, requests fail with a 429 error until capacity comes back, so code waits and retries. when a request is checked, so asking for far more than you need wastes quota. A second region adds quota; a Provisioned deployment reserves throughput.
Part of Foundry now
Azure OpenAI is now one part of Microsoft FoundryMicrosoft FoundryMicrosoft's Azure platform for AI apps and agents, formerly Azure AI Foundry and Azure AI Studio: one resource to deploy models from many makers, build agents and govern both., next to models from Anthropic, Meta and others, agents and their tools. An existing Azure OpenAI resource can be upgraded to a Foundry resource while keeping its address and keys.
Our article Azure OpenAI vs OpenAI puts the 2 side by side, with the code and data rules of each.
Sources