Azure OpenAI Integration

Azure OpenAI provides OpenAI models through Microsoft’s enterprise cloud platform, offering enhanced security, compliance, and integration with existing Azure infrastructure.
Azure OpenAI is ideal for enterprise deployments that require data residency, enhanced security, and integration with existing Azure services.

Why Azure OpenAI?

Enterprise Security

Enhanced Protection
  • Data residency guarantees
  • Enterprise-grade encryption
  • Private network connectivity
  • SOC 2 Type II compliance

Azure Integration

Seamless Ecosystem
  • Azure Active Directory integration
  • Virtual network connectivity
  • Azure Monitor integration
  • Managed identity support

Compliance Ready

Regulatory Standards
  • GDPR compliance
  • HIPAA eligible
  • ISO 27001 certified
  • FedRAMP authorized

SLA Guarantees

Reliable Service
  • 99.9% uptime SLA
  • Dedicated support
  • Predictable performance
  • Enterprise billing

Supported Models

Latest Generation
  • gpt-4: Standard GPT-4 model
  • gpt-4-32k: Extended context version
  • gpt-4-turbo: Faster, more efficient
  • gpt-4-vision: Multimodal capabilities

Prerequisites

1

Azure Subscription

  • Active Azure subscription
  • Permissions to create Azure OpenAI resources
  • Access to Azure OpenAI service (may require approval)
2

Create Azure OpenAI Resource

# Using Azure CLI
az cognitiveservices account create \
  --name "your-openai-resource" \
  --resource-group "your-resource-group" \
  --location "eastus" \
  --kind "OpenAI" \
  --sku "S0"
3

Deploy Models

Deploy the models you want to use:
# Deploy GPT-4 model
az cognitiveservices account deployment create \
  --name "your-openai-resource" \
  --resource-group "your-resource-group" \
  --deployment-name "gpt-4-deployment" \
  --model-name "gpt-4" \
  --model-version "0613" \
  --model-format "OpenAI" \
  --scale-type "Standard"

Configuration

import os
import cognee

# Configure Azure OpenAI
os.environ["LLM_PROVIDER"] = "azure_openai"
os.environ["LLM_API_KEY"] = "your-azure-openai-api-key"
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://your-resource.openai.azure.com/"
os.environ["LLM_MODEL"] = "azure/gpt-4"
os.environ["AZURE_OPENAI_API_VERSION"] = "2024-02-15-preview"

# Test the configuration
print("Azure OpenAI configured successfully!")
import os
import cognee

# Comprehensive Azure OpenAI setup
os.environ["LLM_PROVIDER"] = "azure_openai"
os.environ["LLM_API_KEY"] = "your-azure-openai-api-key"
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://your-resource.openai.azure.com/"
os.environ["LLM_MODEL"] = "azure/gpt-4"
os.environ["AZURE_OPENAI_API_VERSION"] = "2024-02-15-preview"

# Model parameters
os.environ["LLM_TEMPERATURE"] = "0.1"
os.environ["LLM_MAX_TOKENS"] = "4000"
os.environ["LLM_TOP_P"] = "0.95"

# Embedding configuration
os.environ["EMBEDDING_PROVIDER"] = "azure_openai"
os.environ["EMBEDDING_MODEL"] = "azure/text-embedding-ada-002"
os.environ["AZURE_EMBEDDING_DEPLOYMENT"] = "your-embedding-deployment"

print("Advanced Azure OpenAI configuration complete!")

Authentication Methods

Standard Authentication
import os

# Use API key from Azure portal
os.environ["LLM_API_KEY"] = "your-32-character-api-key"
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://your-resource.openai.azure.com/"

Enterprise Features

Private Networking

Next Steps