Concept Intermediate · 3 min read

What is Azure OpenAI On Your Data

Quick answer
Azure OpenAI On Your Data is a service that allows you to securely connect your private data sources to Azure OpenAI models for customized AI-powered insights without data leaving your environment. It uses Azure Cognitive Search and retrieval-augmented generation (RAG) to provide context-aware responses based on your own data.
Azure OpenAI On Your Data is a secure AI integration service that connects your private data with Azure OpenAI models to generate context-rich, customized outputs.

How it works

Azure OpenAI On Your Data works by combining your private data stored in Azure with powerful OpenAI language models through a retrieval-augmented generation (RAG) approach. Your data is indexed using Azure Cognitive Search, which enables fast, relevant retrieval of information. When you send a query, the system first searches your data for relevant context, then feeds that context along with your query into an Azure OpenAI model to generate accurate, data-grounded responses. This ensures your data never leaves your Azure environment, maintaining privacy and compliance.

Think of it as a smart assistant that reads your documents, databases, or knowledge bases on demand and answers questions precisely using that information.

Concrete example

This example shows how to query an Azure OpenAI model with your own data using Azure Cognitive Search and the Azure OpenAI SDK.

python
import os
from openai import AzureOpenAI

# Initialize Azure OpenAI client
client = AzureOpenAI(
    api_key=os.environ["AZURE_OPENAI_API_KEY"],
    azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
    api_version="2024-02-01"
)

# Example query with retrieval context (retrieved from Azure Cognitive Search)
retrieved_context = "Azure OpenAI On Your Data enables secure AI access to private data."

messages = [
    {"role": "system", "content": "You are a helpful assistant that uses provided context."},
    {"role": "user", "content": "What is Azure OpenAI On Your Data?"},
    {"role": "assistant", "content": f"Context: {retrieved_context}"}
]

response = client.chat.completions.create(
    model=os.environ["AZURE_OPENAI_DEPLOYMENT"],
    messages=messages
)

print(response.choices[0].message.content)
output
Azure OpenAI On Your Data is a service that securely connects your private data with Azure OpenAI models, enabling context-aware AI responses without exposing your data externally.

When to use it

  • Use Azure OpenAI On Your Data when you need AI-powered insights grounded in your proprietary or sensitive data stored in Azure.
  • Ideal for enterprise scenarios requiring compliance, data privacy, and control over data access.
  • Not suitable if you want to use OpenAI models without integrating your own data or if your data is not hosted in Azure.

Key terms

TermDefinition
Azure OpenAIMicrosoft's cloud service providing access to OpenAI models with enterprise-grade security.
Azure Cognitive SearchA cloud search service that indexes and queries private data for fast retrieval.
Retrieval-Augmented Generation (RAG)An AI technique combining data retrieval with language model generation for accurate, context-aware responses.
On Your DataRefers to using your own private data as context for AI models without exposing it externally.

Key Takeaways

  • Azure OpenAI On Your Data securely integrates your private Azure data with OpenAI models for customized AI outputs.
  • It uses Azure Cognitive Search to retrieve relevant context before generating responses with OpenAI models.
  • Ideal for enterprises needing data privacy and compliance while leveraging powerful AI capabilities.
Verified 2026-04 · gpt-4o, gpt-4o-mini, azure_openai
Verify ↗