.png)
Azure OpenAI Service Integration Guide
Connect enterprise applications to Azure OpenAI Service through deployment-based REST APIs, secure authentication, synchronous inference, and asynchronous batch workflows.
Azure OpenAI Service integration options at a glance
Azure OpenAI Service primarily integrates through HTTPS REST APIs hosted at an Azure OpenAI resource endpoint. Martini can call chat completion, Responses, embeddings, image generation, audio, file, batch, and supported fine-tuning operations by supplying the API version, deployment name, and API key or Microsoft Entra ID token. Batch workloads are submitted asynchronously and monitored through status polling rather than a general-purpose webhook mechanism. Martini workflows can prepare prompts and files, validate structured responses, apply business rules, persist operation identifiers, and deliver results to applications, databases, Azure AI Search, or file stores. API versions, model capabilities, quotas, and regional availability should remain environment configuration.
Common Azure OpenAI Service integration patterns
Common Azure OpenAI Service data objects used in integrations
Authentication and security considerations
Authentication options
Azure OpenAI Service supports API keys and Microsoft Entra ID bearer tokens. API keys are sent in the api-key header, while OAuth 2.0 access tokens use the applicable Azure Cognitive Services scope and Azure role permissions.
Secure Martini configuration
- Store API keys, OAuth client secrets, endpoints, deployment names, and API versions in Martini secrets or protected environment configuration.
- Use least-privilege Azure permissions and distinguish data-plane inference access from resource and deployment management permissions.
- Use managed identities where the Martini deployment architecture supports Azure-hosted identity flows; otherwise use an appropriately protected service principal or API key.
- Limit logging of prompts, completions, tokens, customer data, and access tokens.
Operational considerations for Azure OpenAI Service integrations
Quotas and retries
Azure OpenAI applies quotas and rate limits that can produce HTTP 429 responses. Martini workflows should use bounded exponential backoff with jitter and should not retry authentication, validation, or other non-transient failures.
Versions and schemas
API versions, deployment names, model capabilities, response schemas, structured output behavior, and regional availability vary. Keep these values configurable and validate generated JSON or other structured output before downstream use.
Asynchronous processing
Batch and fine-tuning workflows require persisted identifiers, status polling, maximum processing windows, terminal failure paths, and reconciliation by stable source identifiers rather than response order.
Data and observability
- Apply idempotency checks before submitting retryable work or writing results.
- Track correlation IDs, deployment names, API versions, status codes, latency, throttling, content filtering, and downstream failures.
- Respect token and context limits by filtering, chunking, or summarizing source content.
- Consider regional processing, retention, encryption, and regulatory requirements before sending data to Azure OpenAI Service.
Why use Martini instead of scripts or point-to-point integrations?
Centralized orchestration
Martini separates enterprise applications from Azure OpenAI-specific endpoints, deployment names, API versions, prompt structures, and response formats. This makes it easier to reuse integration logic across applications.
Reliable processing
Workflows can coordinate synchronous calls, asynchronous batch jobs, scheduled polling, checkpoints, idempotency, retries, validation, and controlled failure paths instead of leaving these concerns in separate scripts.
Consistent governance
Martini provides a place to apply authentication, secrets management, data mapping, business rules, approval checks, and logging policies while limiting sensitive data exposure.
Reusable enterprise APIs
Martini can expose stable APIs that combine Azure OpenAI with document repositories, search services, databases, and business applications without requiring every consumer to understand Azure OpenAI request details.