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
- Go to ai.azure.com
- Sign in with your Azure account credentials
2. Enable the New Foundry Experience
- Look for the "Try the new Foundry" toggle in the portal header
- 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
- Click your project name in the upper-left corner
- Select "Create new project"
2. Configure Settings
| Setting | Recommendation |
|---|---|
| Project name | Descriptive name (e.g., "MyCompany RAG Project") |
| Resource group | Select existing or create new |
| Location | East US 2 or Sweden Central for GPT-4o/GPT-5 |
- Click "Create project" and wait for completion (1-2 minutes)
Part C: Deploy an Azure OpenAI Model
1. Navigate to Models
- Click "Discover" in the upper-right navigation
- Select "Models" in the left pane
2. Find Your Model
Search for or browse to your desired model:
| Model | Best For |
|---|---|
gpt-4o | High-quality answers, production use |
gpt-4o-mini | Cost-effective, good quality |
gpt-4.1-mini | Latest capabilities, cost-effective |
3. Deploy the Model
- Click "Deploy" → "Custom settings"
- Configure:
- Deployment name: e.g.,
gpt-4o-rag - Deployment type: Global Standard (recommended)
- Deployment name: e.g.,
- Click "Deploy"
- Wait for deployment (1-5 minutes)
Part D: Get Your Endpoint and API Key
Understanding Foundry Endpoints
An Azure AI Foundry resource answers on three interchangeable host names, and all of them serve the same model-inference API. The wizard accepts any of them:
| Endpoint Type | URL Pattern |
|---|---|
| Project endpoint | https://your-resource.services.ai.azure.com/api/projects/your-project |
| Azure OpenAI endpoint | https://your-resource.openai.azure.com/openai/v1/ |
| Model Target URI | https://your-resource.cognitiveservices.azure.com/openai/deployments/... |
Note: Paste whichever value Foundry shows you. The wizard trims the path back to the resource URL (e.g.
https://your-resource.services.ai.azure.com/) automatically.
1. Get the Endpoint URL and API Key
The quickest source is the project Home page - the panel under the welcome banner lists API key, Project endpoint, and Azure OpenAI endpoint side by side.
- Click "Home" in the upper-right navigation
- Copy the Project endpoint (or the Azure OpenAI endpoint - either works)
- Copy the API key from the same panel (32+ characters)
Alternatively, from the deployment details:
- Click "Build" in the upper-right navigation
- Select "Deployments" in the left pane
- Click the radio button (selection circle) next to the deployment to open details
- Copy the Project endpoint and API Key from the right-hand panel
Tip: Don't click the deployment name - that opens the Playground. Click the radio button instead.
2. Note Your Deployment Name
The deployment name (e.g., gpt-4o) is visible in:
- The deployment list
- The deployment details panel
Summary: Information for the Wizard
| Field | Example |
|---|---|
| Display Name | My Azure OpenAI |
| Endpoint URL | https://your-resource.services.ai.azure.com/ |
| API Key | (32+ character key) |
| Deployment Name | gpt-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-miniwhich is generally available
"Must be a valid Azure endpoint"
- The endpoint must start with
https:// - The host must be one of
services.ai.azure.com,cognitiveservices.azure.com, oropenai.azure.com - All three are valid; you do not need to convert between them
Can't find the endpoint
- Check the project Home page panel first - it shows the API key and both endpoints
- In Build → Deployments, click the radio button next to the deployment, not the name
- Look in the details panel that appears on the right