Azure OpenAI Service
Deploy a GPT model in Azure OpenAI Service, call the completions API from a script, and understand responsible AI principles and content filtering options.
What Is Azure OpenAI Service?
Azure OpenAI Service provides access to OpenAI's large language models — including GPT-4, GPT-3.5-turbo, DALL-E, and Embeddings models — through Microsoft's Azure cloud infrastructure. Unlike using the OpenAI API directly, Azure OpenAI gives you enterprise features: private networking via VNet/Private Link, Microsoft's compliance certifications (ISO 27001, SOC 2, GDPR), content filtering, customer data privacy (your data is not used to train OpenAI's base models), and integration with Azure RBAC and monitoring.
Requesting Access and Deploying Models
Azure OpenAI requires an approved subscription — access is gated and must be requested via a form. Once approved, you create an Azure OpenAI resource, then create a deployment within it. A deployment binds a model (e.g. gpt-4) to a deployment name (e.g. my-gpt4) and a token quota (tokens-per-minute limit). You call the API using your deployment name, not the base model name. Multiple deployments with different models or quotas can coexist in one resource.
# Create an Azure OpenAI resource
az cognitiveservices account create \
--name myOpenAI \
--resource-group myRG \
--kind OpenAI \
--sku S0 \
--location eastus
# Create a deployment
az cognitiveservices account deployment create \
--name myOpenAI \
--resource-group myRG \
--deployment-name my-gpt4 \
--model-name gpt-4 \
--model-version '0613' \
--model-format OpenAI \
--sku-name Standard \
--sku-capacity 10