ARTICLE - AI & Large Models

Azure OpenAI Deployment and RAG Integration

Production readiness depends on more than model choice: availability, region, and quota determine whether requests can run; identity and networking determine who can connect; retrieval quality determines whether RAG answers have evidence.

2026-08-06 Microsoft Learn 119 views
Advertisement

Before using Azure OpenAI, confirm three things: the model can be deployed in the selected Azure cloud and region, the subscription has the required quota, and the application identity has permission to call it. Then choose the API and retrieval design. Model availability, regions, and API capabilities change, so don't copy model names, API versions, or quota figures from an old article into production settings.

Check model, region, and capacity before deployment

When selecting a model in the Microsoft Foundry catalog, check its version, deployment type, supported regions, API compatibility, and lifecycle status. A model listing doesn't mean it can be deployed in every region. The catalog and deployment options in the portal are the checkpoints for the selected subscription and region.

Choose a deployment according to the workload. Pay-as-you-go deployments suit variable traffic that can use shared capacity. If throughput needs to be more predictable, evaluate Provisioned Throughput (PTU) and its capacity commitment. Global, Data Zone, and regional deployments have different processing scopes and pricing bases, so comparing model names alone is insufficient. Verify current input/output token or PTU pricing and model-level TPM/RPM quota. Quota controls throttling; it is not a billable rate and doesn't by itself guarantee the throughput you need.

Deployment approach When to assess it Check before launch
Pay-as-you-go Variable traffic billed by usage Model/region rates, TPM/RPM quota, and throttling
Provisioned Throughput (PTU) A need for provisioned capacity or more predictable throughput PTU capacity, commitment term, and model/region availability

Global, Data Zone, and regional describe processing scope and should be checked separately from pay-as-you-go or PTU capacity. See the official quota documentation for quota scope and requests.

After deployment, record the resource endpoint, deployment name, model/version, region, API, and authentication method. Calls commonly pass the deployment name rather than the catalog model ID; confirm the field expected by the specific API.

Send a request with the Responses API

This Python example uses the OpenAI SDK v1 endpoint and an API key. First deploy a model that supports the Responses API in your resource, then set the endpoint, key, and deployment name in environment variables. Don't commit keys to a repository or expose them in a browser client.

import os
from openai import OpenAI

endpoint = os.environ["AZURE_OPENAI_ENDPOINT"].rstrip("/")
client = OpenAI(
    api_key=os.environ["AZURE_OPENAI_API_KEY"],
    base_url=f"{endpoint}/openai/v1/",
)

response = client.responses.create(
    model=os.environ["AZURE_OPENAI_DEPLOYMENT"],
    input="Reply with the exact words: Azure request verified.",
)
print(response.output_text)

On success, the program prints the model response; the expected sample text is Azure request verified. If authentication fails, confirm that the key and endpoint belong to the same resource. If the deployment can't be found, verify that the value is a deployment name and that the deployment and region support the Responses API.

An API key is suitable for a local connectivity check. For production, evaluate Microsoft Entra ID and managed identity and grant the application the required Azure OpenAI data-plane role to avoid storing a long-lived key. Restricted networks also require Private Endpoint, DNS, and access-policy configuration; creating a Private Endpoint alone doesn't complete DNS resolution or authorization.

Build RAG on Azure AI Search and validate it

RAG passes retrieved material to a model as context; it doesn't mean the model automatically knows the entire knowledge base. A common flow is to prepare and chunk documents, generate and index vectors, retrieve against a question using keyword/vector or hybrid search, select a limited set of relevant passages, then send them to the model with source identifiers. Hybrid search and semantic ranking can help recall, but implementers still own index fields, chunk size, filters, and access controls.

RAG request and validation boundaries User query Identity and scope AI Search Retrieve and filter Relevant chunks Keep source IDs Model answer Cite or abstain No unauthorized retrieval Check index if empty Check relevance and scope State when evidence lacks Basis: classic RAG application flow App controls retrieval access and source checks
Figure 1: RAG request path through retrieval, model generation, and source checks (Source: classic RAG flow; retrieval authorization and source validation remain application responsibilities)

Before launch, test questions with known answers and source documents instead of checking only for an HTTP 200 response:

  1. Confirm that retrieved passages support the answer and record document IDs or links so each answer is traceable.
  2. Test questions with no relevant source and verify the model states that evidence is insufficient rather than inventing details.
  3. Test retrieval filters with different user identities to ensure users can't retrieve unauthorized documents. Enforce access at retrieval time; a system prompt is not an authorization control.
  4. Separate retrieval failures from generation failures. For empty results, inspect the index, query wording, and filters. If retrieval is relevant but the answer is wrong, inspect the prompt, context length, and model behavior.

Microsoft Learn's On Your Data API reference states that the feature retired on 2026-10-14 and is no longer supported. Don't use its legacy API or examples as a new integration path. Use Azure AI Search retrieval APIs/classic RAG or another currently supported route, and manage retrieval, authorization, and citations in the application. For current options, see the Azure AI Search RAG overview.

Version, cost, and change control

Models and APIs evolve. Validate a candidate model and API in a nonproduction deployment, then run representative prompts against tool calls, structured output, citation accuracy, abstention, and latency. Record the deployment name, model version, API, and change date. Upgrade policies and support lifecycles differ across models; don't assume every deployment can be pinned or automatically upgraded in the same way.

Separate budget assumptions by model and deployment type. For pay-as-you-go, check input and output usage and the model/region rate; for PTU, check provisioned capacity and commitment terms. Azure AI Search has its own service/capacity costs, and vectorization can incur additional model or processing costs. Estimate tokens and retrieval load from real request samples, then set Azure Cost Management budgets and alerts. TPM/RPM limits aren't a substitute for cost alerts.

Limitations

  • Model, deployment-type, API, and region support changes. A model in the catalog isn't necessarily deployable in the target region, cloud, or subscription. Check current model and region tables before deployment.
  • Microsoft Entra ID requires the right resource permissions and network connectivity. A managed identity avoids secret management but doesn't grant call permissions automatically.
  • A Private Endpoint provides a private network entry point; DNS, subnet, routing, resource network policy, and role assignments must also be verified.
  • RAG supplies retrieved content to the model but doesn't guarantee factual answers. Index freshness, relevance, access filters, and citation checks remain application responsibilities.
  • Azure OpenAI On Your Data retired on 2026-10-14. A replacement retrieval design isn't automatically feature-equivalent; revalidate retrieval, permissions, and citation behavior.

FAQ

Which name should the Azure OpenAI model parameter use?

Use the deployment name, not the model catalog ID. If the API can't find a deployment, check the resource endpoint, deployment name, API/model compatibility, and deployment status in the Foundry portal. A catalog listing alone doesn't confirm that a callable deployment exists. A successful response confirms that the endpoint and deployment are reachable.

Is Azure OpenAI TPM a billing unit?

No. TPM/RPM are throughput quotas or rate limits, not API billing rates. Pay-as-you-go billing depends on the model, input/output tokens, deployment type, and region; PTU billing follows provisioned capacity and applicable commitment terms. Quota can be shared or change by subscription, model, and deployment category. Use live usage and pricing data for a budget, not TPM alone.

Can a production app use Azure OpenAI without a stored key?

Yes, a production app can use a managed identity instead of a stored API key. Assign it the required Azure OpenAI data-plane role and verify that the host can reach the endpoint. The app then requests a Microsoft Entra ID token. Developers can test locally with Azure CLI, but CI/CD and non-Azure hosts need a separate credential design. If access fails just after a role assignment, allow time for the change to take effect before investigating other causes.

Can a new project still use Azure OpenAI On Your Data?

It shouldn't be the default for a new project. Microsoft Learn states that the service retired on 2026-10-14 and is no longer supported. A new RAG app can use Azure AI Search for indexing and retrieval, then pass authorized relevant passages to the model. Revalidate data access, retrieval quality, and citations during migration instead of assuming the old API behavior is preserved.

Related Providers

  • Azure AI: use it to check Foundry/Azure OpenAI model, region, access, and service options within an Azure subscription.
  • OpenAI: compare the direct OpenAI API when deciding whether Azure identity, networking, or compliance requirements apply.

References

Community & Resources

Original source: Microsoft Learn ↗