Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.44 KB

getting-started-azure-openai.md

File metadata and controls

39 lines (25 loc) · 1.44 KB

Microsoft Foundry and Azure OpenAI Setup

Use the course setup guide for the complete instructions. It covers local development and Codespaces, Foundry project creation, model deployment, API keys, environment variables, and a live companion app check.

Connection Settings

The companion app already uses the openai JavaScript package. You do not need to install @azure/openai, create a hub, or replace the app's client code.

Create .env in the repository root with these values from your Foundry resource:

AI_API_KEY=your_microsoft_foundry_api_key
AI_ENDPOINT=https://your-resource.openai.azure.com/openai/v1
AI_MODEL=gpt-5-mini

AI_MODEL must be your deployment name. AI_ENDPOINT must be the Azure OpenAI-compatible API base URL, not the Foundry project URL or a full chat-completion request URL.

Follow Set Up Microsoft Foundry to obtain these values, then Configure Environment Variables.

Run and Verify

From the repository root:

npm ci
npm ci --prefix app
npm --prefix app start

Open http://localhost:3000, select a character, and send a message. In Codespaces, keep port 3000 private.

For an existing environment file:

ENV_FILE="$HOME/.env" npm --prefix app start

See Test Your Setup and Troubleshooting for verification and error handling.