Skip to main content

Azure OpenAI Setup Guide

This guide walks you through deploying an Azure OpenAI model using Microsoft Foundry. The deployed model powers the AI answer synthesis for your RAG retriever.

Prerequisites

  • An Azure account with an active subscription
  • Owner access to the subscription (to create a Foundry resource), or an existing Foundry resource
  • A supported region (East US 2, Sweden Central recommended for latest models)

Part A: Access Microsoft Foundry Portal

1. Navigate to the Portal

  1. Go to ai.azure.com
  2. Sign in with your Azure account credentials

2. Enable the New Foundry Experience

  1. Look for the "Try the new Foundry" toggle in the portal header
  2. Turn the toggle ON for the latest experience

Note: All links to Microsoft Foundry open whichever portal version you last used.

Part B: Create a Foundry Project

Skip this section if you already have a Foundry project.

1. Create New Project

  1. Click your project name in the upper-left corner
  2. Select "Create new project"

2. Configure Settings

SettingRecommendation
Project nameDescriptive name (e.g., "MyCompany RAG Project")
Resource groupSelect existing or create new
LocationEast US 2 or Sweden Central for GPT-4o/GPT-5
  1. Click "Create project" and wait for completion (1-2 minutes)

Part C: Deploy an Azure OpenAI Model

1. Navigate to Models

  1. Click "Discover" in the upper-right navigation
  2. Select "Models" in the left pane

2. Find Your Model

Search for or browse to your desired model:

ModelBest For
gpt-4oHigh-quality answers, production use
gpt-4o-miniCost-effective, good quality
gpt-4.1-miniLatest capabilities, cost-effective

3. Deploy the Model

  1. Click "Deploy""Custom settings"
  2. Configure:
    • Deployment name: e.g., gpt-4o-rag
    • Deployment type: Global Standard (recommended)
  3. Click "Deploy"
  4. Wait for deployment (1-5 minutes)

Part D: Get Your Endpoint and API Key

Understanding Foundry Endpoints

Foundry shows multiple endpoints - use the correct one:

Endpoint TypeURL PatternUse For
❌ Project Endpointservices.ai.azure.com/api/projects/...Foundry APIs only
✅ Model Target URIcognitiveservices.azure.com/openai/...Model inference

Warning: Use the cognitiveservices.azure.com URL, NOT the services.ai.azure.com URL.

1. Navigate to Your Deployment

  1. Click "Build" in the upper-right navigation
  2. Select "Models" in the left pane
  3. Find your deployment in the list
  4. Click the radio button (selection circle) next to the deployment to open details

Tip: Don't click the deployment name - that opens the Playground. Click the radio button instead.

2. Get the Endpoint URL

  1. Look for the Target URI field (NOT "Project endpoint")
  2. You'll see a URL like:
    https://your-resource.cognitiveservices.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-05-01-preview
  3. Copy just the base URL:
    https://your-resource.cognitiveservices.azure.com/

Note: The wizard automatically strips the path if you paste the full Target URI.

3. Get the API Key

  1. Click "View code" or "Code" tab
  2. Find the api-key value in the code examples
  3. Copy the key (32+ characters)

4. Note Your Deployment Name

The deployment name (e.g., gpt-4o) is visible in:

  • The Target URI path
  • The deployment list
  • The deployment details panel

Summary: Information for the Wizard

FieldExample
Display NameMy Azure OpenAI
Endpoint URLhttps://your-resource.cognitiveservices.azure.com/
API Key(32+ character key)
Deployment Namegpt-4o

Troubleshooting

"No quota available in this region"

  • Try East US 2, Sweden Central, or West Europe
  • Request quota increase via Azure support

"Model not available"

  • Some models require registration
  • Try gpt-4o-mini which is generally available

Endpoint shows wrong format

  • Use Target URI (cognitiveservices.azure.com), not Project endpoint (services.ai.azure.com)
  • Both cognitiveservices.azure.com and openai.azure.com formats work

Can't find Target URI

  • Click the radio button next to the deployment, not the name
  • Look in the details panel that appears on the right