Overview of Azure OpenAI
Overview of Azure OpenAI
1 Overview
Modules 1 and 2 made AI your assistant. Module 3 reverses the arrow: your applications become the caller, and OpenAI's models become a service your C# code consumes. The front door to that world for .NET teams is Azure OpenAI — OpenAI's model families operated as a first-class Azure service, inside your subscription, your identity system, your network, and your compliance boundary.
This tutorial is the map before the journey: what the service actually provides, how resources and deployments are structured, which model families exist and what they cost, the quota system that governs throughput, the Responsible AI machinery built into the platform, the Studio portal where you'll prototype, and — the decision every project makes early — how to choose the right model for a scenario.
Nothing here requires writing code yet; everything here is assumed by the code you'll write next. Teams that skip this layer end up confused about why their 'GPT-4o' code fails (they never deployed one), why bills surprise them (output tokens), or why load tests hit 429s (quota) — an hour of concepts now prevents all three.
2 Learning Objectives
After completing this tutorial, you will be able to:
- Explain what Azure OpenAI provides beyond raw model access — identity, networking, compliance, and data-handling guarantees.
- Describe the resource → deployment → call structure and why code targets deployment names.
- Distinguish standard, global, and provisioned throughput deployment options at a concept level.
- Survey the model families — GPT-4o and its mini variant, GPT-4 Turbo, embeddings models — and their roles.
- Reason about pricing: input vs output tokens, and quotas expressed as tokens per minute.
- State Microsoft's Responsible AI principles and how content filtering embodies them in the service.
- Navigate Azure OpenAI Studio (Azure AI Foundry) for deployments and playground experiments.
- Choose a model for a scenario using the capability–cost–latency triangle.
3 Prerequisites
- Tutorial 1's foundations: tokens, context windows, embeddings, and the three Microsoft AI products.
- Basic Azure familiarity: subscriptions, resources, resource groups, and the portal.
- An Azure subscription if you want to follow the step-by-step section hands-on (not required for the concepts).
- No new C# is needed this tutorial — code arrives in tutorial 11.
4 What Azure OpenAI Provides
Azure OpenAI is not 'a proxy to someone else's API'. It is the OpenAI model families — chat, reasoning, embeddings, image generation — operated by Microsoft as an Azure service, which changes four things that enterprises care about more than model quality:
- Identity and access: calls authenticate with API keys or, properly, Microsoft Entra ID with role-based access — the same identity fabric as the rest of your estate; no shared secrets in production.
- Network posture: resources support private endpoints and VNet integration, so AI traffic never crosses the public internet if you so choose.
- Data handling: your prompts and completions are not used to train the foundation models, and processing stays within your chosen Azure geography — the contractual answers to 'where does our data go?'.
- Operations: billing on your subscription, quotas you manage, Azure Monitor integration, SLAs, and regional deployment choices — a model as a managed Azure dependency, not an external experiment.
The mental model that organizes everything else: an Azure OpenAI resource is a container you create in a region; inside it you create one or more model deployments — named instances of specific models; and your code talks to the resource's endpoint, addressing a deployment name. The deployment indirection is the practical genius of the design: applications reference 'chat-prod', and which underlying model version that means is an operational decision you can change without touching code.
5 Deployment Models: From Resource to Running Requests
Deployments come in flavors that matter at different scales. Standard is pay-as-you-go against your regional quota — the default for development and most production workloads. Global variants route requests across Microsoft's global capacity for better availability of scarce models, trading strict regional processing. Provisioned throughput reserves dedicated capacity (purchased as PTUs) for workloads needing predictable latency at high volume — call-center scale, not side-project scale. Names and exact options evolve; the concept triangle — shared vs global vs dedicated capacity — is stable.
6 The Model Families: GPT-4o, GPT-4 Turbo, and Embeddings
The model catalog is a moving target — new versions ship, old ones retire on published schedules — but the family structure is durable and is what you should learn:
| Family | Role | Traits that drive selection |
|---|---|---|
| GPT-4o | The multimodal flagship: chat, reasoning over text and images | Highest general capability; large context; premium price per token |
| GPT-4o mini | The workhorse: same family, smaller | A fraction of the cost and latency; remarkably capable for extraction, classification, summarization — the default until proven insufficient |
| GPT-4 Turbo | Previous-generation large model | Still deployed in the wild; large context; generally superseded — prefer 4o-family for new work |
| Reasoning models (o-series) | Extended internal reasoning for hard problems | Slower and costlier per request; shines on complex multi-step tasks; overkill for routine calls |
| text-embedding-3 (small/large) | Text → vectors for search and RAG | Not a chat model at all; very cheap; the engine behind tutorial 15's retrieval |
Two structural points beginners miss. First, chat models and embeddings models are different tools, not quality tiers — a complete AI feature typically deploys one of each (retrieval finds, chat writes; tutorial 1's division of labor). Second, model versions are explicit: a deployment pins a model version, versions have retirement dates, and upgrades are your scheduled operational act — with your regression set from tutorial 6 run before the switch, because prompts are model-sensitive.
7 Pricing: Tokens, Meters, and Quotas
Azure OpenAI's economics reduce to one sentence: you pay per token, in both directions, at rates that vary by model — and you are throttled per minute by quota. Everything you send — system message, conversation history, retrieved documents — meters as input tokens; everything generated meters as output tokens, at a higher rate (often 3–4×). This is why tutorial 3's history management and tutorial 4's context precision are cost engineering, not just craft: replayed history is re-billed every turn.
Quota is the operational half: each subscription receives per-region, per-model capacity expressed as tokens per minute (with a derived requests-per-minute), which you divide among deployments when creating them. Quota is not a bill — it's a ceiling; you can request increases. Provisioned throughput replaces the shared-pool model entirely with reserved capacity for workloads where p99 latency matters more than pay-as-you-go flexibility. The practical rules: watch usage metadata from day one, alert on 429 rates, and remember that the cheapest optimization is almost always a smaller model or a leaner prompt, not a bigger quota.
8 Responsible AI: Principles Into Platform
Microsoft operates Azure OpenAI under its Responsible AI standard — six principles that sound abstract until you meet their concrete platform embodiments: fairness (systems should treat people equitably), reliability and safety (systems should perform safely under expected and unexpected conditions), privacy and security (data protected and under user control), inclusiveness (systems should empower everyone), transparency (people should understand how decisions are made), and accountability (humans remain answerable for the systems they deploy).
In the service, the principles are machinery, not posters. Content filtering runs on every request by default: classifiers screen both prompts and completions across harm categories (hate, sexual, violence, self-harm, plus jailbreak detection), blocking above configurable severity thresholds — your application must handle 'the filter blocked this' as a normal response case. Access controls and abuse monitoring govern the service itself. Data-handling commitments (no training on your prompts; regional processing) implement privacy. And the accountability principle lands on you: the platform provides the guardrails, but what your application does with model output — tutorial 6's validation, gating, and human-in-the-loop design — remains your responsibility, explicitly.
9 Azure OpenAI Studio and the Tooling Around the Service
Azure OpenAI Studio — whose capabilities now live in the Azure AI Foundry portal — is the service's workbench: the place where concepts in this tutorial become clickable reality. What you do there:
- Deployments: browse the model catalog (families, versions, regional availability), create deployments, assign quota slices, and manage version upgrades.
- The chat playground: interactive prompt iteration against your deployments — system message editing, parameter sliders (temperature, max tokens), and conversation testing. Tutorial 2's iteration loop has a home here before any code exists.
- View code: the playground exports your current setup as starter code — a bridge to tutorial 11.
- Content filter configuration: view and (within policy) adjust category thresholds per deployment.
- Quota management: see per-region allocations and consumption, request increases.
Around the portal sits the standard Azure toolchain: everything the Studio does is scriptable via the Azure CLI and infrastructure-as-code (Bicep/Terraform) for real environments — resource, deployments, and network configuration in source control like any other infrastructure. And for code, the SDK families (Azure.AI.OpenAI for .NET among them) speak to the same endpoints — next tutorial's subject. The workflow that works: prototype prompts in the playground, export the shape, industrialize in C# with configuration and identity done properly.
10 Choosing the Right Model for a Scenario
Model selection is a triangle: capability (can it do the task well?), cost (per token, at your volume), and latency (time to first token and to completion). You cannot maximize all three; scenarios pick their corner:
| Scenario | Sensible starting model | Why |
|---|---|---|
| High-volume extraction / classification (tickets, invoices) | GPT-4o mini | Structured tasks with clear prompts; mini-class capability suffices; volume makes cost dominant |
| Customer-facing chat over your docs (RAG) | GPT-4o mini or GPT-4o + text-embedding-3 | Retrieval does the knowledge work; chat model writes; upgrade only if answer quality demands |
| Complex analysis, multi-step reasoning, hard synthesis | GPT-4o (or a reasoning model for the hardest cases) | Capability corner: errors cost more than tokens |
| Semantic search / similarity / clustering | text-embedding-3 (small or large) | Not a chat problem at all; embeddings are the tool and cost pennies |
| Real-time UX (autocomplete-ish, interactive) | Smallest model that clears quality bar | Latency corner; streaming + small model beats brilliant + slow |
| Batch overnight processing | Larger model acceptable | Latency irrelevant; spend the budget on quality where it counts |
The professional's default: start with the mini-class model and real test cases; escalate to the flagship only where measured quality falls short; and split pipelines — a cheap model for the bulk step, the expensive model for the hard 10%. Selection is also not permanent: the deployment indirection means the model behind 'chat-prod' is an operational dial, and your tutorial 6 regression set is the gate every time you turn it.
11 Code Examples in C#
Code proper begins next tutorial; here, the two C# artifacts worth having before any call is made. First, configuration that mirrors the service's structure — resource endpoint plus deployment names, never raw model names, never secrets in source:
// appsettings.json (non-secret parts):
// {
// "AzureOpenAI": {
// "Endpoint": "https://my-resource.openai.azure.com/",
// "ChatDeployment": "chat-prod", // -> GPT-4o mini today; swappable
// "EmbeddingDeployment": "embed-prod" // -> text-embedding-3-large
// }
// }
// Key (dev only - prefer Entra ID in production):
// dotnet user-secrets set "AzureOpenAI:ApiKey" "<key>"
public sealed class AzureOpenAIOptions
{
public const string SectionName = "AzureOpenAI";
public required Uri Endpoint { get; init; }
public required string ChatDeployment { get; init; }
public required string EmbeddingDeployment { get; init; }
public string? ApiKey { get; init; } // null => use Entra ID credential
}
Second, a tiny cost model — the kind of helper that keeps token economics visible in design discussions before any invoice arrives:
public static class TokenCost
{
// Illustrative per-1K-token rates - REAL rates vary by model and change;
// read them from configuration, sourced from current published pricing.
public static decimal EstimateRequestCost(
int inputTokens, int outputTokens,
decimal inputPer1K, decimal outputPer1K) =>
inputTokens / 1000m * inputPer1K +
outputTokens / 1000m * outputPer1K;
// ~4 chars per token English heuristic (tutorial 1) for pre-call sizing:
public static int RoughTokens(string text) =>
(int)Math.Ceiling(text.Length / 4.0);
}
// Design-time sanity check for a summarization feature:
// 2,000 input tokens + 300 output, 50k requests/month
// -> run the numbers per candidate model BEFORE building.
12 Step-by-Step: Standing Up Your First Azure OpenAI Resource
The hands-on path from nothing to a tested deployment — portal edition (every step scriptable later via CLI/Bicep):
- Check model availability first: consult the model-availability documentation and pick a region that has the models you want (a chat model and an embeddings model). Region is hard to change later.
- Create the resource: Azure portal → Create resource → Azure OpenAI; choose subscription, resource group, the region from step 1, a resource name (it becomes your endpoint), and a pricing tier.
- Open the Studio/Foundry portal from the resource and go to Deployments: deploy a chat model — pick the family (e.g. GPT-4o mini to start), a version, a deployment name your code will use ('chat-dev'), and a quota slice (TPM).
- Deploy an embeddings model the same way ('embed-dev' → a text-embedding-3 model) — most real features need both, and deploying now saves a context switch later.
- Test in the chat playground: select 'chat-dev', write a system message, converse; adjust temperature and max tokens and watch behavior change — tutorial 2's iteration loop, live.
- Trip the content filter deliberately (ask for something the harm categories block) to see what a filtered response looks like — your code will need to handle this case gracefully.
- Collect connection details: from the resource — endpoint URL and keys (Keys and Endpoint blade). Note them into user-secrets, not source; production will use Microsoft Entra ID instead.
- Check Quotas: see your TPM allocation per model and region, how much your deployments consumed, and where to request increases — the page you'll revisit when load testing.
- Optional but wise: use 'View code' in the playground to see your setup expressed as SDK calls — a preview of exactly what tutorial 11 builds properly.
13 Limitations and Caveats
- Everything specific ages fast: model names, versions, context sizes, prices, quota defaults, and portal layouts all change on months-scale. The families, the resource→deployment structure, and the selection axes are the durable knowledge; verify specifics against current documentation at build time.
- Naming is in transition: 'Azure OpenAI Studio' capabilities now live in the Azure AI Foundry portal — expect both names in docs and this course; they refer to the same workbench.
- Model availability is uneven across regions; the model you want may dictate your region, with data-residency consequences to check.
- Quota is a ceiling, not a guarantee of instant capacity — scarce models can be constrained; production plans include retry/backoff and sometimes multi-region strategies.
- Content filtering will occasionally block legitimate content (false positives) — handle filtered responses as a normal case, and know the adjustment process for your workload.
- Model retirements are real: deployments pin versions, versions have end-of-life dates, and upgrades are scheduled operational work gated by your regression set.
- Pricing in this tutorial is deliberately unstated in numbers: any figure printed here would be wrong within months. The cost model (input/output per-token, output premium) is the stable part.
14 Best Practices and Common Mistakes
The habits to establish before writing a line of calling code:
- Name deployments by role ('chat-prod', 'embed-dev'), never by model — preserve the indirection that makes upgrades codeless.
- Choose regions by model availability and residency needs, deliberately, first.
- Start with mini-class models; escalate on measured evidence, not vibes; split pipelines cheap-bulk/expensive-hard.
- Log usage metadata from the first prototype call; estimate costs at design time with the back-of-envelope model.
- Keep secrets in user-secrets/Key Vault from day one; plan production for Entra ID, not keys.
- Prototype prompts in the playground; export via View code; industrialize in C#.
- Handle content-filter blocks and 429s as normal response cases in every client you write.
The beginner mistakes this tutorial exists to prevent:
- Calling model names instead of deployment names, then being confused by 404s.
- Creating the resource in a region that lacks the model you actually wanted.
- Defaulting to the flagship model for everything and discovering the bill at month-end.
- Ignoring output-token premium — 'it's just a summary' at 4× input rates, times a million calls.
- Load-testing into 429s with no backoff and calling the service 'unreliable'.
- Treating content filtering as an error to eliminate rather than a case to handle.
- Hard-coding keys in source 'temporarily' — tutorial 6's rule did not expire.
- Assuming today's model catalog is tomorrow's — skipping the regression gate on upgrades.
20 Summary & Key Takeaways
- Azure OpenAI = frontier models + enterprise wrapper: Entra ID, private networking, no-training data commitments, regional processing, subscription operations.
- Structure everything on resource → deployment → call; name deployments by role and keep the indirection that makes upgrades codeless.
- Know the families — GPT-4o flagship, mini workhorse, o-series reasoning, text-embedding-3 vectors — and that chat vs embeddings is a division of labor.
- Economics: tokens both ways, output at a premium, history re-billed — prompt economy is cost engineering; log usage from call one.
- Quota throttles (429s), it doesn't bill — backoff, alerts, and capacity math are client responsibilities; PTUs exist for latency-critical scale.
- Responsible AI is machinery (content filtering, data handling) plus your retained accountability — filtered responses are a normal case to handle.
- The Studio/Foundry playground hosts prompt iteration before code; View code bridges to the SDK; real environments are scripted as IaC.
- Choose models by the capability–cost–latency triangle: mini-first, escalate on evidence, split pipelines, and re-verify with regression sets on every swap.
The platform layer is mapped. Next: the code — building a proper C# client for everything defined here, with configuration, identity, streaming, and error handling done the production way.
21 Next Steps
Continue with the next tutorial in the path: Calling Azure OpenAI from C# — the Azure.AI.OpenAI SDK, chat completions, streaming, embeddings calls, and the client patterns (retry, usage logging, filter handling) that this tutorial's concepts demand.
- Hands-on: run the section 12 walkthrough — resource, two deployments, playground session, deliberate filter trip, quota page visit.
- Practice: compute a design-time cost estimate for one feature you'd actually build — tokens per request × volume × current rates for two candidate models.
- Practice: write your team's deployment-naming convention and region-decision notes — one paragraph each, versioned with your infrastructure code.
- Reading: the Azure OpenAI models documentation (current families, versions, availability) and the quotas & limits page — the two pages this tutorial deliberately refuses to freeze in time.
- Looking ahead: keep the resource from the walkthrough alive — tutorial 11's code connects to it in the first ten minutes.
15 Quiz
Pick an answer for each question, then press Check answer. (Notes are disabled in this tab.)
1. What does Azure OpenAI fundamentally provide?
2. Why does application code target a deployment name rather than a model name?
3. What is the resource → deployment structure?
4. Which pairing correctly matches model family to role?
5. What is GPT-4o mini's role in a well-run system?
6. How does Azure OpenAI pricing meter a request?
7. What does a deployment's TPM (tokens per minute) quota govern?
8. When does provisioned throughput make sense over standard pay-as-you-go?
9. Which are Microsoft's Responsible AI principles embodied in the service?
10. How should your application treat content filtering?
11. What is Azure OpenAI Studio (Azure AI Foundry) primarily for?
12. Why does region choice matter at resource creation?
13. A real-time interactive feature needs snappy responses at scale. Which triangle corner leads, and what follows?
14. What operational fact about model versions must production teams plan for?
15. Which authentication approach should production applications use?
16 Exam Questions
Try answering each question yourself before expanding the model answer.
1. Enumerate what Azure OpenAI provides beyond raw model access, and explain why each matters to an enterprise .NET team.
2. Explain the resource → deployment → call architecture and the engineering value of the deployment indirection.
3. Survey the model families and give the selection reasoning a team should apply, including the mini-first default.
4. Break down the pricing and quota model, and derive four cost-engineering practices from it.
5. Present Microsoft's six Responsible AI principles and trace each to something concrete a .NET developer encounters.
6. Describe Azure OpenAI Studio's role in a professional workflow, from prototype to production.
7. A team must pick regions and structure resources for dev and prod. Lay out the decision process and a sensible baseline topology.
8. Explain why 'chat model vs embeddings model' is a division of labor, not a quality tier, with a concrete feature walkthrough.
9. Design the client-side handling for the two 'normal failure' cases this tutorial introduces: content-filter blocks and 429 throttling.
10. What is the model lifecycle operational burden, and what does a mature team's upgrade playbook look like?
11. Argue the pricing triangle (capability/cost/latency) with three scenarios where each different corner wins, including the reasoning.
12. How do this tutorial's platform concepts retroactively explain practices from Modules 1–2? Trace at least four connections.
13. Write the briefing you'd give a security/compliance officer evaluating Azure OpenAI adoption.
14. Plan the first two weeks of a team's Azure OpenAI enablement, before feature development starts.
15. Scenario: a startup defaults everything to the flagship model and gets a shocking first invoice; latency also disappoints. Diagnose using this tutorial's concepts and prescribe.
17 Flashcards
Click a card to reveal the back.
Azure OpenAI in one sentence
Resource → deployment → call
Why deployment names by role
The model families
Chat vs embeddings models
Pricing model
Quota (TPM)
Provisioned throughput (PTU)
Responsible AI — six principles
Content filtering
Azure OpenAI Studio / AI Foundry
Region choice
Capability–cost–latency triangle
Mini-first default
Model lifecycle ops
Production auth
18 Interview Questions & Answers
1. Why would an enterprise use Azure OpenAI instead of calling a model provider's public API directly?
2. Explain deployments and why your code never references a model name directly.
3. How do you choose a model for a new feature?
4. Walk me through the cost model and how you keep bills predictable.
5. What's quota, and how does it differ from billing?
6. What does Responsible AI mean concretely when you build on this platform?
7. What role does the Studio/playground play for a professional team?
8. How do regions affect your architecture decisions?
9. Chat models versus embeddings models — why does a typical feature need both?
10. What operational surprises should a team expect in their first quarter with the service?
11. How does authentication differ between development and production?
12. A stakeholder asks: 'Is our data used to train the AI?' Give your precise answer.
13. How would you design the upgrade process when a model version faces retirement?
14. What belongs in a team's 'which model for what' one-pager?
15. Sum up what a developer must internalize from the platform layer before writing calling code.
19 Glossary
- Azure OpenAI
- OpenAI's model families operated as an Azure service — identity, networking, compliance, quota, and billing within your subscription.
- Resource (Azure OpenAI)
- The regional container you create: owns the endpoint, keys/identity binding, network configuration, and data-residency anchor.
- Model deployment
- A named instance of a specific model version inside a resource, with an assigned quota slice — the thing your code actually calls.
- Deployment name
- The role-based identifier ('chat-prod') applications target; the indirection that makes model upgrades codeless.
- Endpoint
- The resource's base URL (https://<name>.openai.azure.com) receiving all API calls for its deployments.
- GPT-4o family
- The current multimodal flagship line; the mini variant is the cost/latency workhorse and the sensible default.
- GPT-4 Turbo
- Previous-generation large-context model, still encountered in deployments but superseded for new work.
- Reasoning models (o-series)
- Models performing extended internal reasoning — higher latency and cost, justified by genuinely hard multi-step problems.
- text-embedding-3
- The embeddings family (small/large) converting text to vectors for search, similarity, and RAG — priced in pennies.
- Input tokens
- The metered measure of everything sent: system message, history, documents. Replayed history re-bills every turn.
- Output tokens
- The metered measure of everything generated — billed at a premium, hence max-token caps and concise-output design.
- Quota
- Per-region, per-model capacity allowance (TPM/RPM) divided among deployments; exceeding it throttles with 429s.
- Tokens per minute (TPM)
- The throughput ceiling unit of quota; the number capacity planning maps expected load against.
- Provisioned throughput (PTU)
- Reserved dedicated capacity purchased for predictable latency at scale — the alternative to the shared pool.
- Responsible AI principles
- Microsoft's six: fairness, reliability & safety, privacy & security, inclusiveness, transparency, accountability — machinery in the platform, obligations in your app.
- Content filtering
- Default classifiers on prompts and completions across harm categories, blocking above thresholds; a normal response case for client code.
- Azure OpenAI Studio
- The service workbench — now within the Azure AI Foundry portal: deployments, playground, filters, quota, View-code export.
- Playground
- The interactive chat environment for prompt iteration against real deployments before any code exists.
- Region
- The resource's Azure geography — determining model availability, quota grants, and data residency; effectively immutable per resource.
- Model catalog
- The evolving set of deployable models and versions; current truth lives in the portal, not in tutorials.
- Model retirement
- The published end-of-life of a model version, making upgrades scheduled operational work gated by regression sets.
- Capability–cost–latency triangle
- The selection framework: scenarios pick a corner; no model wins all three; mini-first with measured escalation.
- Microsoft Entra ID (for AOAI)
- The keyless production authentication path: managed identity + RBAC replacing shared API keys.