Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Azure OpenAI Service — OpenAI models (GPT-4o, DALL-E 3, Whisper) on Azure infrastructure. Use when deploying OpenAI models with enterprise compliance (GDPR, HIPAA, SOC2), Azure-native auth via Managed Identity, content filtering, or VNET-isolated deployments. Same OpenAI API, hosted on Azure.
.claude/skills/terminalskills-azure-openai/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-22 | ✗→✓ | ▲ Improved | 157% | 0% |
| case-08 | ✓→✓ | = Same ✓ | 87% | 0% |
| case-10 | ✓→✓ | = Same ✓ | 195% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 170% | 0% |
| case-07 | ✓→✓ | = Same ✓ | 54% | 0% |
Azure OpenAI Service provides OpenAI's models (GPT-4o, GPT-4o mini, DALL-E 3, Whisper) hosted on Microsoft Azure infrastructure. It offers enterprise features: Managed Identity authentication (no API keys), VNET integration, Azure Policy compliance, content filtering, abuse monitoring, and regional data residency. Uses the same openai Python/TS SDK — just point it at your Azure endpoint.
| Feature | OpenAI (direct) | Azure OpenAI | |---|---|---| | Auth | API Key | API Key or Managed Identity | | Data residency | US primarily | Any Azure region | | Enterprise compliance | Limited | SOC2, HIPAA, ISO 27001 | | Content filtering | ❌ | ✅ Configurable | | VNET isolation | ❌ | ✅ Private endpoints | | Deployment control | Shared | Your own deployments | | Fine-tuning | ✅ | ✅ | | Latency to Azure services | Higher | Lower (co-located) |
bashpip install openai azure-identity # azure-identity for Managed Identity
bash# API Key auth (dev/test) export AZURE_OPENAI_API_KEY=... export AZURE_OPENAI_ENDPOINT=https://my-resource.openai.azure.com/ # Deployment names (you set these when deploying models in Azure Portal) export AZURE_OPENAI_DEPLOYMENT=gpt-4o # Your deployment name
pythonfrom openai import AzureOpenAI client = AzureOpenAI( api_key="your_azure_openai_api_key", azure_endpoint="https://my-resource.openai.azure.com/", api_version="2024-10-21", # Check docs for latest stable version ) response = client.chat.completions.create( model="gpt-4o", # This is your DEPLOYMENT NAME, not the model name messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is Azure OpenAI Service?"}, ], max_tokens=1024, temperature=0.7, ) print(response.choices[0].message.content)
pythonfrom openai import AzureOpenAI from azure.identity import DefaultAzureCredential, get_bearer_token_provider # DefaultAzureCredential works with: # - Managed Identity (in Azure VM, AKS, App Service, Functions) # - Azure CLI (local development) # - Visual Studio / VS Code credentials credential = DefaultAzureCredential() token_provider = get_bearer_token_provider( credential, "https://cognitiveservices.azure.com/.default" ) client = AzureOpenAI( azure_endpoint="https://my-resource.openai.azure.com/", azure_ad_token_provider=token_provider, api_version="2024-10-21", ) response = client.chat.completions.create( model="gpt-4o", # deployment name messages=[{"role": "user", "content": "Hello!"}], ) print(response.choices[0].message.content)
typescriptimport OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.AZURE_OPENAI_API_KEY, baseURL: `${process.env.AZURE_OPENAI_ENDPOINT}openai/deployments/${process.env.AZURE_OPENAI_DEPLOYMENT}`, defaultQuery: { "api-version": "2024-10-21" }, defaultHeaders: { "api-key": process.env.AZURE_OPENAI_API_KEY }, }); const response = await client.chat.completions.create({ model: process.env.AZURE_OPENAI_DEPLOYMENT!, messages: [{ role: "user", content: "Explain TypeScript generics." }], }); console.log(response.choices[0].message.content);
pythonfrom openai import AzureOpenAI client = AzureOpenAI( api_key="...", azure_endpoint="https://my-resource.openai.azure.com/", api_version="2024-10-21", ) stream = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Write a sonnet about cloud computing."}], stream=True, ) for chunk in stream: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True) print()
pythonimport json from openai import AzureOpenAI client = AzureOpenAI( api_key="...", azure_endpoint="https://my-resource.openai.azure.com/", api_version="2024-10-21", ) tools = [ { "type": "function", "function": { "name": "get_azure_resource_cost", "description": "Get the cost of an Azure resource for the current month", "parameters": { "type": "object", "properties": { "resource_group": {"type": "string"}, "resource_name": {"type": "string"}, }, "required": ["resource_group", "resource_name"], }, }, } ] messages = [{"role": "user", "content": "How much is my vm-prod01 costing this month?"}] response = client.chat.completions.create( model="gpt-4o", messages=messages, tools=tools, tool_choice="auto", ) if response.choices[0].finish_reason == "tool_calls": tool_call = response.choices[0].message.tool_calls[0] args = json.loads(tool_call.function.arguments) print(f"Called: {tool_call.function.name} with {args}") messages.append(response.choices[0].message) messages.append({ "role": "tool", "tool_call_id": tool_call.id, "content": json.dumps({"cost_usd": 142.53, "currency": "USD"}), }) final = client.chat.completions.create(model="gpt-4o", messages=messages) print(final.choices[0].message.content)
pythonfrom openai import AzureOpenAI client = AzureOpenAI( api_key="...", azure_endpoint="https://my-resource.openai.azure.com/", api_version="2024-02-01", # DALL-E uses a different API version ) response = client.images.generate( model="dall-e-3", # your DALL-E 3 deployment name prompt="A futuristic city skyline with solar panels, photorealistic, golden hour", size="1024x1024", quality="hd", n=1, ) print(response.data[0].url) print(f"Revised prompt: {response.data[0].revised_prompt}")
pythonfrom openai import AzureOpenAI client = AzureOpenAI( api_key="...", azure_endpoint="https://my-resource.openai.azure.com/", api_version="2024-06-01", ) with open("recording.mp3", "rb") as audio_file: transcript = client.audio.transcriptions.create( model="whisper", # your Whisper deployment name file=audio_file, language="en", response_format="text", ) print(transcript)
pythonfrom openai import AzureOpenAI client = AzureOpenAI( api_key="...", azure_endpoint="https://my-resource.openai.azure.com/", api_version="2024-10-21", ) response = client.embeddings.create( model="text-embedding-3-large", # deployment name input=["The quick brown fox", "Jumps over the lazy dog"], ) for item in response.data: print(f"Embedding {item.index}: {len(item.embedding)} dims")
A critical Azure OpenAI concept: deployments are your named instances of a model:
Azure Portal:
Resource: my-openai-resource
Deployments:
- Name: "gpt-4o" → Model: gpt-4o (2024-11-20)
- Name: "gpt-4o-mini" → Model: gpt-4o-mini (2024-07-18)
- Name: "text-embed-large" → Model: text-embedding-3-largeIn code, model= takes the deployment name you configured, not the OpenAI model name.
Content filters are configured in Azure Portal under your deployment settings:
python# When content is filtered, the API returns an error: from openai import AzureOpenAI, BadRequestError client = AzureOpenAI(...) try: response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "user_input"}], ) except BadRequestError as e: if e.code == "content_filter": print(f"Content filtered: {e.error.innererror}")
api_version to a stable version — latest is not always most stable.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | pass→pass | 10,042 | 6,676 | -34% | 1 | 1 | 0% | 2,050 | 3,824 | +87% | 0 | 0 | — |
case-09 | fail→fail | 8,678 | 5,826 | -33% | 1 | 1 | 0% | 1,531 | 3,674 | +140% | 0 | 0 | — |
case-10 | pass→pass | 6,555 | 7,476 | +14% | 1 | 1 | 0% | 1,363 | 4,023 | +195% | 0 | 0 | — |
case-06 | pass→pass | 6,589 | 4,973 | -25% | 1 | 1 | 0% | 1,291 | 3,487 | +170% | 0 | 0 | — |
case-07 | pass→pass | 13,524 | 8,996 | -33% | 1 | 1 | 0% | 2,883 | 4,452 | +54% | 0 | 0 | — |
case-01 | fail→fail | 10,056 | 9,529 | -5% | 1 | 1 | 0% | 2,142 | 4,562 | +113% | 0 | 0 | — |
case-02 | pass→pass | 7,837 | 8,185 | +4% | 1 | 1 | 0% | 1,580 | 3,467 | +119% | 0 | 0 | — |
case-03 | pass→pass | 6,646 | 4,746 | -29% | 1 | 1 | 0% | 1,272 | 3,621 | +185% | 0 | 0 | — |
case-04 | pass→pass | 5,006 | 2,463 | -51% | 1 | 1 | 0% | 924 | 2,992 | +224% | 0 | 0 | — |
case-05 | pass→pass | 3,662 | 2,487 | -32% | 1 | 1 | 0% | 645 | 3,003 | +366% | 0 | 0 | — |
case-11 | pass→pass | 10,838 | 7,086 | -35% | 1 | 1 | 0% | 1,992 | 3,965 | +99% | 0 | 0 | — |
case-12 | pass→pass | 8,600 | 3,543 | -59% | 1 | 1 | 0% | 1,565 | 3,215 | +105% | 0 | 0 | — |
case-13 | pass→pass | 10,414 | 8,732 | -16% | 1 | 1 | 0% | 1,957 | 4,064 | +108% | 0 | 0 | — |
case-14 | pass→pass | 13,351 | 15,233 | +14% | 1 | 1 | 0% | 2,477 | 5,605 | +126% | 0 | 0 | — |
case-15 | fail→fail | 7,192 | 4,639 | -35% | 1 | 1 | 0% | 1,300 | 3,414 | +163% | 0 | 0 | — |
case-16 | pass→pass | 7,764 | 3,636 | -53% | 1 | 1 | 0% | 1,355 | 3,094 | +128% | 0 | 0 | — |
case-17 | pass→pass | 10,447 | 10,087 | -3% | 1 | 1 | 0% | 1,744 | 4,470 | +156% | 0 | 0 | — |
case-18 | pass→pass | 12,024 | 8,220 | -32% | 1 | 1 | 0% | 1,973 | 3,947 | +100% | 0 | 0 | — |
case-19 | pass→pass | 4,810 | 2,572 | -47% | 1 | 1 | 0% | 820 | 3,006 | +267% | 0 | 0 | — |
case-20 | pass→pass | 7,249 | 8,507 | +17% | 1 | 1 | 0% | 1,659 | 4,417 | +166% | 0 | 0 | — |
case-21 | pass→pass | 3,941 | 2,981 | -24% | 1 | 1 | 0% | 742 | 3,117 | +320% | 0 | 0 | — |
case-22 | fail→pass | 6,919 | 6,573 | -5% | 1 | 1 | 0% | 1,456 | 3,745 | +157% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.