Azure

Azure OpenAI Service Primer: Model Selection, PTU, Prompt Engineering, Function Calling & Embeddings

2026-05-24
NicheeLab Editorial Team

Azure OpenAI Service is a managed service that delivers OpenAI's GPT models (gpt-4o, o1, o3 series), DALL-E, Whisper, and Embeddings on Microsoft Azure. While functionally and performance-wise nearly identical to the native OpenAI API, it adds enterprise-grade security, compliance, and integration. This article walks through model selection, deployment models, Prompt Engineering, Function Calling, Embeddings, and security in a single comprehensive view.

Differences from the OpenAI API

ItemOpenAI API (Native)Azure OpenAI Service
ProviderOpenAI directlyMicrosoft Azure
AuthenticationAPI Key onlyMicrosoft Entra ID + Managed Identity
Private Network×Private Endpoint
EncryptionStandardCustomer-Managed Key
SLAStandard99.9% (99.99% with PTU)
ComplianceLimitedSOC 2 / HIPAA / ISO 27001 / PCI DSS / FedRAMP
Use caseIndividual dev / PoCEnterprise production

Key Models

ModelCharacteristicsUse case
gpt-4oMultimodal, image input, high performance, low costDefault pick
gpt-4o-miniFast, cheapest (~1/10 the price of gpt-4o)High-volume processing, chat
gpt-4 TurboLegacy, long-term supportExisting systems
o1-preview / o1-miniReasoning models for complex inferenceMath, complex coding
o3-miniLatest reasoning model, cost-efficientReasoning + cost balance
text-embedding-3-large3,072-dimensional embeddingHigh-accuracy RAG
text-embedding-3-small1,536-dimensional embeddingLow-cost RAG
DALL-E 3Image generationMarketing, design
WhisperSpeech recognition / transcriptionAudio → text
GPT-4o RealtimeReal-time voice dialogVoice AI assistants

Standard Deployment vs PTU

ItemStandard (Pay-as-you-go)Provisioned Throughput Units (PTU)
BillingPer-tokenReserved capacity, fixed monthly
ResourcesSharedDedicated
Latency guaranteeNoneYes
SLA99.9%99.99%
Minimum unitNone50 PTU
Monthly cost guideUsage-basedFrom several hundred thousand yen
Use caseDev, PoC, small-scale productionLarge-scale production, SLA requirements

Region Strategy

  • Global Standard: Processes in any Microsoft region (data region agnostic)
  • Data Zone Standard: Processes within specific data-residency regions (GDPR / Japan data residency)

Reserved Capacity (1-year contract) also provides substantial PTU monthly discounts.

Prompt Engineering

Basic Structure

  • System Message: Defines the assistant's role and constraints (most important)
  • User Message: User's question or instruction
  • Assistant Message: Response (retained as ChatHistory)

Key Techniques

  1. Zero-shot: No examples, simple questions
  2. Few-shot: 3-5 examples to teach behavior patterns
  3. Chain of Thought (CoT): Instruct "think step by step" to improve reasoning accuracy
  4. Role Playing: Assign a persona like "you are a medical specialist"
  5. Structured Output: Specify a JSON Schema for structured responses
  6. Temperature tuning: 0 = deterministic, 1 = creative
  7. Top-p tuning: Cumulative probability threshold
  8. Frequency / Presence Penalty: Suppress repetition

In production, centrally manage a Prompt Library, iterate continuously with A/B tests, and design Prompt Injection defenses.

Function Calling / Tool Calling

Lets an LLM autonomously invoke external functions / APIs.

Common Use Cases

  • Weather API calls
  • Database queries
  • Running calculations
  • Email / Slack notifications
  • Calling other LLM APIs (multi-agent pattern)

Implementation Flow

  1. Define the Functions Schema (name, args, types, descriptions)
  2. Pass the function list via the Tools argument on ChatCompletion
  3. If the LLM decides a call is needed, it returns a tool_calls array
  4. Client executes the corresponding function
  5. Return the result to the LLM as a Tool Message
  6. LLM produces the final response based on the result

Azure AI Foundry Agent Service abstracts complex multi-step Function Calling and enables more advanced agent patterns.

Embeddings and Vector Search

Embeddings convert "text → vector (high-dimensional numeric array)" so semantic similarity can be computed.

How It Works

  1. Split documents into chunks (200-1,000 tokens)
  2. Vectorize each chunk via the Embedding API
  3. Store vectors in a vector database (Azure AI Search, Cosmos DB Vector, PostgreSQL pgvector)
  4. Vectorize the user's query via the Embedding API
  5. Retrieve top-K nearest chunks using Cosine Similarity / Dot Product
  6. Include retrieved chunks in the GPT-4o prompt to generate the response (RAG pattern)

Azure AI Search's Vector Search is built-in, and Hybrid Search (Vector + Full-text + BM25) further improves accuracy. See the RAG Pattern Implementation Guide for details.

Security and Governance

  1. Microsoft Entra ID auth + Managed Identity (no API Key required)
  2. Private Endpoint for fully private access (privatelink.openai.azure.com)
  3. Customer-Managed Key encryption (Key Vault integration)
  4. Microsoft Defender for AI detects anomalous usage
  5. Content Filter: Auto-blocks Hate / Self-harm / Sexual / Violence (4 severity tiers)
  6. Prompt Shield: Detects Jailbreak / Prompt Injection (direct + indirect attacks)
  7. Groundedness Detection: Hallucination detection
  8. Protected Material Detection: Flags copyright-infringing content
  9. Usage Logs (Diagnostic Logs): Ships all Prompt / Response audit logs
  10. Cost Management integration for token spend

Cost Optimization

  1. Right-size model selection (use gpt-4o-mini if it suffices)
  2. Minimize prompts (keep System Message concise)
  3. Minimize Few-shot examples
  4. Cap output tokens with max_tokens
  5. Use text-embedding-3-small when high accuracy is not required
  6. Caching (Semantic Cache reuses responses for similar queries)
  7. Batch API for non-real-time workloads (50% discount)
  8. Discount PTU with Reserved Capacity
  9. Continuously monitor token spend with Azure Monitor
  10. Share internal templates via a Prompt Library

Operational Best Practices

  1. Use Managed Identity + Private Endpoint in production
  2. Content Filter + Prompt Shield + Groundedness Detection are mandatory
  3. Standardize across the org via a Prompt Library
  4. Type safety via Structured Output (JSON Schema)
  5. Integrate externally with Function Calling
  6. Leverage internal data via the RAG pattern
  7. Evaluation pipeline via Prompt Flow in Azure AI Foundry
  8. Ship Diagnostic Logs to Microsoft Sentinel, anomaly detection via KQL
  9. Monthly review of token spend via Cost Management
  10. Comply with the 6 Responsible AI principles (Fairness, Transparency, Accountability, Privacy, Inclusiveness, Reliability)

Related Certifications

Frequently Asked Questions

What is Azure OpenAI Service?

Azure OpenAI Service is a managed service that delivers OpenAI's GPT models (gpt-4o, gpt-4o-mini, o1, o3 series), DALL-E (image generation), Whisper (speech recognition), and Embeddings models on Microsoft Azure. While functionally and performance-wise nearly identical to the native OpenAI API, Azure integration provides: 1) Microsoft Entra ID auth + Managed Identity (secretless), 2) fully private access via Private Endpoint (no public internet), 3) Customer-Managed Key encryption, 4) Microsoft Defender for AI integration, 5) enterprise compliance (SOC 2 / HIPAA / ISO 27001 / PCI DSS / FedRAMP), 6) Azure SLA 99.9% (99.99% with Provisioned Throughput Units), 7) Microsoft 365 / Power Platform integration. It is the standard choice for production enterprise generative AI and a core topic on the AI-103 exam.

How do you choose a model?

Key Azure OpenAI models: 1) gpt-4o (multimodal, image input, high performance, low cost, default pick), 2) gpt-4o-mini (fast, cheapest, ~1/10 the price of gpt-4o, for high-volume workloads), 3) gpt-4 Turbo (legacy, long-term support), 4) o1-preview / o1-mini (reasoning models for complex inference, expensive), 5) o3-mini (latest reasoning model, cost-efficient), 6) text-embedding-3-large / small (embedding generation, required for RAG), 7) DALL-E 3 (image generation), 8) Whisper (speech recognition), 9) GPT-4o Realtime (real-time voice dialog). Selection: 1) general chat / summarization → gpt-4o-mini (cost-optimal), 2) high accuracy → gpt-4o, 3) complex reasoning, math, coding → o1 / o3, 4) RAG embeddings → text-embedding-3-large. Apply for quota in Model Catalog, then deploy; note that available models vary by region.

What is the difference between Standard Deployment and Provisioned Throughput Units (PTU)?

Standard Deployment (Pay-as-you-go): per-token billing (input + output), shared resources, scales with demand, throughput limits (tokens per minute / TPM), suitable for dev, PoC, and small-scale production. Provisioned Throughput Units (PTU): reserved capacity with fixed monthly cost, dedicated resources, latency guarantees, for large-scale production and 99.99% SLA requirements; minimum 50 PTU at several hundred thousand yen/month. Selection: under a few million tokens/month → Standard, tens of millions of tokens/month + latency requirements → PTU, enterprise production apps → PTU recommended. There is also a Global Standard vs Data Zone Standard choice: Global Standard processes in any Microsoft region (data region agnostic), Data Zone Standard processes within specific data-residency regions (GDPR / Japan data residency). Reserved Capacity (1-year contract) provides substantial PTU discounts.

What are the basics of Prompt Engineering?

Prompt Engineering is the discipline of designing inputs (prompts) to LLMs. Basic structure: 1) System Message (defines the assistant's role and constraints; the most important), 2) User Message (the user's question or instruction), 3) Assistant Message (response, retained as ChatHistory). Key techniques: 1) Zero-shot (no examples, simple questions), 2) Few-shot (3-5 examples to teach behavior patterns), 3) Chain of Thought (CoT — instruct "think step by step" to improve reasoning), 4) Role Playing (assign a persona like "you are a medical specialist"), 5) Structured Output (specify a JSON Schema for structured responses), 6) Temperature tuning (0 = deterministic, 1 = creative), 7) Top-p tuning (cumulative probability threshold), 8) Frequency / Presence Penalty (suppress repetition). In production, centrally manage a Prompt Library, iterate with A/B tests, and design defenses against Prompt Injection.

How do you use Function Calling / Tool Calling?

Function Calling (Tool Calling) lets an LLM autonomously invoke external functions / APIs. Common use cases: 1) weather API calls ("What's the weather in Tokyo?" → call get_weather('Tokyo') → summarize result), 2) database queries ("What were 2024 sales?" → call query_sales('2024') → format result), 3) calculations ("complex tax calculation" → call calculate_tax), 4) email / messaging ("notify Slack" → call send_slack_message), 5) calling other LLM APIs (multi-agent pattern). Implementation flow: 1) define Functions Schema (name, args, types, descriptions), 2) pass the function list via the Tools argument on ChatCompletion, 3) if the LLM decides a call is needed, it returns a tool_calls array, 4) the client executes the corresponding function, 5) the result is returned to the LLM as a Tool Message, 6) the LLM produces the final response based on the result. Azure AI Foundry Agent Service abstracts complex multi-step Function Calling and enables more advanced agent patterns.

How do Embeddings and Vector Search work?

Embeddings convert "text → vector (high-dimensional numeric array)" so semantic similarity can be computed. text-embedding-3-large is 3,072-dimensional (high accuracy); small is 1,536-dimensional (fast, low cost). Flow: 1) split documents into chunks (200-1,000 tokens), 2) vectorize each chunk via the Embedding API, 3) store vectors in a vector database (Azure AI Search Vector, Cosmos DB Vector, PostgreSQL pgvector), 4) vectorize the user's query via the Embedding API, 5) retrieve the top-K nearest chunks using Cosine Similarity / Dot Product, 6) include retrieved chunks in the GPT-4o prompt to generate the response (RAG pattern). Azure AI Search's Vector Search is built-in, and Hybrid Search (Vector + Full-text + BM25) further improves accuracy. See the RAG Pattern Implementation Guide for the detailed implementation.

What about security and governance?

Azure OpenAI security features: 1) Microsoft Entra ID auth + Managed Identity (secretless, no API keys), 2) Private Endpoint for fully private access (privatelink.openai.azure.com), 3) Customer-Managed Key encryption (Key Vault integration), 4) Microsoft Defender for AI for anomalous-usage detection, 5) Content Filter auto-blocks Hate / Self-harm / Sexual / Violence (4 severity tiers), 6) Prompt Shield detects Jailbreak / Prompt Injection (direct + indirect attacks), 7) Groundedness Detection catches Hallucinations, 8) Protected Material Detection flags copyright-infringing content, 9) Usage Logs (Diagnostic Logs) ship all Prompt / Response audit logs, 10) Cost Management integration for token spend. In production, Content Filter + Prompt Shield + Microsoft Sentinel integration for anomaly detection plus Logic App Playbook auto-response is the standard pattern, and Responsible AI 6-principle compliance is mandatory.

What are the related certifications?

AI-103 (Developing AI Apps and Agents on Azure, GA 2026-06) covers Azure OpenAI deeply in Domain 2 (Generative AI 30-35%) and is the flagship certification for this area. AI-901 (AI Fundamentals, GA 2026-06, AI-900 successor) covers generative AI fundamentals; AZ-204 (Developer Associate, retiring 2026-07) covers Azure OpenAI SDK from a developer view; SC-100 (Cybersecurity Architect Expert) covers AI security and Responsible AI; DP-700 (Fabric Data Engineer) covers data prep pipelines for AI; AZ-305 (Solutions Architect Expert) covers AI architecture decisions. For Azure AI engineers, understanding Azure OpenAI is mandatory and is a core focus area for AI-103 study.

Related Articles and Technical Deep Dives

Azure AI エンジニア キャリアロードマップ|AI-901 → AI-103 → 生成 AI アーキテクトへの道【2026 年版】

Azure AI エンジニアになるための認定取得ロードマップ完全版。AI-901 (2026-06 GA、AI-900 後継) → AI-103 (2026-06 GA、AI-102 後継) の最新ルート、Azure AI Foundry / Agent Service / OpenAI 中心の生成 AI 時代の構成、Databricks GenAI / OpenAI Direct との二刀流戦略、年収レンジまで日本語で網羅。

AI-103 完全ガイド|Developing AI Apps and Agents on Azure【2026 年 6 月 GA・AI-102 後継】

Microsoft Certified: Developing AI Apps and Agents on Azure (AI-103) の完全ガイド。AI-102 の後継として 2026 年 6 月 30 日 GA。Azure AI Foundry / Agent Service / OpenAI / AI Search を中心に、RAG パターン・Agent オーケストレーション・Responsible AI・Semantic Kernel SDK の実装スキル、3-4 ヶ月の合格ロードマップを日本語で網羅。

Azure AI Foundry 完全ガイド|Hub/Project・Prompt Flow・Agent Service・Model Catalog・Fine-tuning【2026 年版】

Microsoft Azure AI Foundry (旧 AI Studio) の完全ガイド。Hub-Project 階層・Prompt Flow LLM ワークフロー・Agent Service・Evaluation メトリクス・Model Catalog (1,800+ モデル)・Fine-tuning・Content Safety・関連認定試験 (AI-103 / AI-901) を日本語で網羅。

Azure RAG パターン実装ガイド|Chunking・Embedding・Azure AI Search・Hallucination 削減【2026 年版】

Azure での RAG (Retrieval-Augmented Generation) パターン完全実装ガイド。5 ステップパイプライン (Ingestion・Chunking・Embedding・Indexing・Retrieval・Generation)・Azure AI Search Vector Search・Hybrid Search・Semantic Ranking・Hallucination 削減・関連認定試験 (AI-103 / DP-420) を日本語で網羅。

Technical information in this article is based on the Azure OpenAI Service Documentation. This article is not an official Microsoft Corporation product and has no affiliation or sponsorship relationship. Microsoft, Azure, and Azure OpenAI are trademarks of the Microsoft group of companies. OpenAI is a trademark of OpenAI, Inc. Information reflects official public materials as of May 24, 2026. Always check the official pages for the latest information.

Check what you learned with practice questions

Practice with certification-focused question sets

Visit the Azure Exam Prep Page
Author

NicheeLab Editorial Team

NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.


Related articles
Azure

AZ-900 Azure Fundamentals: Complete Exam Guide (2026)

Pass AZ-900 — cloud concepts, Azure architecture, management...

Azure

Azure Certification Roadmap: Which Cert to Take Next (2026)

Choose your Azure certification path — Fundamentals, Associa...

Azure

AI-901 Azure AI Fundamentals (Beta): Complete Guide (2026)

Pass AI-901 — Microsoft Foundry, generative AI, responsible ...

Azure

Microsoft Entra ID Fundamentals for Azure Certs (2026)

Entra ID basics every cert candidate needs — tenants, identi...

Azure

DP-900 Azure Data Fundamentals: Complete Guide (2026)

Pass DP-900 — relational, non-relational, analytics, Power B...

Browse all Azure articles (104)
© 2026 NicheeLab All rights reserved.