This document covers everything you need to install, configure, and provision before running Children's Story Studio or following the extension guides.
- Required Tools
- VS Code Extensions
- Azure Resource Provisioning
- Environment Configuration
- Local Setup
- Authentication
- VS Code Tasks
Ensure the following tools are installed on your machine:
| Tool | Minimum Version | Purpose |
|---|---|---|
| Python | 3.11+ | Backend runtime |
| Node.js | 18+ | Frontend runtime (includes npm) |
| VS Code | Latest | Development environment |
| Azure CLI | Latest | Authentication (az login) and resource management |
| Git | Latest | Version control, branch switching |
Verify installations:
python --version # Should show 3.11+ node --version # Should show 18+ code --version # Should print VS Code version az --version # Should print Azure CLI version git --version # Should print Git version
The following VS Code extensions are required for the guided walkthroughs. Make sure each is installed and enabled before proceeding.
The extension guides rely heavily on GitHub Copilot for code generation. You'll use two distinct modes:
- Plan Mode (with Claude Opus, or your preferred model) — Copilot analyzes your codebase and produces a detailed implementation plan without making changes. Use this first to understand the scope of work.
- Agent Mode (with Claude Sonnet, or your preferred model) — Copilot actively implements changes across multiple files. Use this after reviewing and approving the plan.
Install: Search for "GitHub Copilot" in the VS Code Extensions panel (
Ctrl+Shift+X/Cmd+Shift+X) and install both GitHub Copilot and GitHub Copilot Chat.
The AI Toolkit for VS Code (published by Microsoft) provides AI-focused development capabilities that you'll use throughout these guides:
- Agent Trace Viewer — View OpenTelemetry traces from your agent workflow directly in VS Code, including LLM call details, prompt/response inspection, and per-agent latency. Used in the OTEL Observability guide (AI Toolkit variant).
- Model Catalog — Browse and compare available AI models from Azure AI Foundry without leaving your editor.
- Prompt Playground — Test and iterate on system prompts before committing them into agent code — useful when designing new agents in the Activity Page Agents guide.
Install: Search for "AI Toolkit" in the VS Code Extensions panel and install AI Toolkit for Visual Studio Code (published by Microsoft).
Context7 is a Model Context Protocol (MCP) server that provides GitHub Copilot with up-to-date, version-specific documentation for libraries and frameworks. This is particularly valuable when working with newer libraries like Microsoft Agent Framework, where Copilot's training data may not include the latest APIs.
When Context7 is enabled and you include use context7 in your Copilot prompts, it will automatically fetch current documentation for the libraries you're using — ensuring generated code uses correct, up-to-date APIs.
Setup: Follow the Context7 MCP Server setup instructions to add it to your VS Code MCP configuration. Ensure the Context7 MCP server is listed and enabled in your VS Code MCP settings.
The base application requires an Azure AI Foundry project with two model deployments. Follow these steps to provision the required resources.
- Navigate to the Azure Portal and search for "Azure AI Foundry".
- Click + Create to create a new hub resource (or use an existing one).
- Select your Subscription, Resource Group, and Region.
- Once the hub is created, navigate into it and click + New project to create a project within the hub.
- Give your project a name (e.g.,
childrens-story-studio) and click Create.
- Inside your Azure AI Foundry project, navigate to Deployments (or Model catalog).
- Search for and select GPT-5.2 (or your preferred model).
- Click Deploy and configure the deployment:
- Deployment name:
gpt-5.2(or your preferred name — you'll set this in.env) - Model version: Use the latest available version
- Deployment type: Standard
- Deployment name:
- Note the deployment name for your
.envconfiguration.
- In the same Deployments section, search for an image generation model (e.g., gpt-image-2, gpt-image-1.5 or dall-e-3).
- Click Deploy and configure:
- Deployment name:
gpt-image-1.5(or your preferred name — match whatever you set in.env) - Use default settings for other options.
- Deployment name:
- Note the deployment name.
- In your Azure AI Foundry project, navigate to Overview or Settings.
- Copy the Project endpoint URL — it will look like:
https://<your-resource>.services.ai.azure.com/api/projects/<your-project> - This is the value for
FOUNDRY_PROJECT_ENDPOINTin your.env.
Ensure your Azure account has the necessary role assignments on the AI Foundry resource:
- Cognitive Services OpenAI User (or Cognitive Services Contributor) — required for chat and image generation API access.
You can assign roles via the Azure Portal under Access control (IAM) on the AI Foundry resource, or via CLI:
# Get your Azure account object ID
az ad signed-in-user show --query id -o tsv
# Assign the role (replace placeholders)
az role assignment create \
--role "Cognitive Services OpenAI User" \
--assignee <your-object-id> \
--scope /subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.CognitiveServices/accounts/<resource-name>Note: This section is only required if you plan to follow the Text-to-Speech Guide. Skip this for the base application and the Activity Page Agents guide.
- In the Azure Portal, search for "Speech" and select Speech under Azure AI services.
- Click + Create.
- Configure:
- Subscription: Your Azure subscription
- Resource Group: Same as your AI Foundry resources (recommended)
- Region: Choose a region that supports neural TTS voices (e.g.,
eastus,westus2,westeurope). Note this region — you'll need it forAZURE_SPEECH_REGION. - Name: e.g.,
story-studio-speech - Pricing tier: Standard S0
- Click Review + Create, then Create.
After the resource is created, you'll need three values for your .env:
- Region (
AZURE_SPEECH_REGION): The region you selected (e.g.,eastus). - Endpoint (
AZURE_SPEECH_ENDPOINT): Found in the resource's Overview or Keys and Endpoint section. It will look like:https://<region>.api.cognitive.microsoft.com/ - Resource ID (
AZURE_SPEECH_RESOURCE_ID): Found in the resource's Properties section. It will look like:/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.CognitiveServices/accounts/<resource-name>
Assign the Cognitive Services Speech User role to your Azure account on the Speech resource:
az role assignment create \
--role "Cognitive Services Speech User" \
--assignee <your-object-id> \
--scope /subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.CognitiveServices/accounts/<speech-resource-name>Important: The TTS implementation uses
DefaultAzureCredential(viaaz login) for authentication — not API keys. The role assignment above is what grants access.
The backend uses a .env file for configuration. A .env.example template is provided.
cd backend
cp .env.example .envOpen backend/.env in your editor and configure the following variables:
| Variable | Required | Default | Description |
|---|---|---|---|
FOUNDRY_PROJECT_ENDPOINT |
Yes | "" |
Your Azure AI Foundry project endpoint URL |
FOUNDRY_MODEL_DEPLOYMENT_NAME |
No | gpt-5.2 |
The name of your chat model deployment |
FOUNDRY_IMAGE_MODEL_DEPLOYMENT_NAME |
No | gpt-image-1.5 |
The name of your image generation model deployment |
CORS_ORIGIN |
No | http://localhost:5173 |
The frontend's origin URL for CORS |
TTS Variables (Only for TTS Guide)
| Variable | Required for TTS | Default | Description |
|---|---|---|---|
AZURE_SPEECH_REGION |
Yes | — | Azure region of your Speech resource (e.g., eastus) |
AZURE_SPEECH_ENDPOINT |
Yes | — | Full endpoint URL of your Speech resource |
AZURE_SPEECH_RESOURCE_ID |
Yes | — | Full Azure resource ID of your Speech resource |
# Azure AI Foundry
FOUNDRY_PROJECT_ENDPOINT=https://your-resource.services.ai.azure.com/api/projects/your-project
FOUNDRY_MODEL_DEPLOYMENT_NAME=gpt-5.2
FOUNDRY_IMAGE_MODEL_DEPLOYMENT_NAME=gpt-image-1.5
# Application settings
CORS_ORIGIN=http://localhost:5173
# Azure AI Speech (only needed for TTS functionality)
# AZURE_SPEECH_REGION=eastus
# AZURE_SPEECH_ENDPOINT=https://eastus.api.cognitive.microsoft.com/
# AZURE_SPEECH_RESOURCE_ID=/subscriptions/.../resourceGroups/.../providers/Microsoft.CognitiveServices/accounts/...# Navigate to the backend directory
cd backend
# Create a Python virtual environment
python -m venv .venv
# Activate the virtual environment
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows
# Install Python dependencies
pip install -r requirements.txtTip: If you encounter issues installing
agent-framework-coreoragent-framework-azure-ai, ensure yourpipis up to date:pip install --upgrade pip
# Navigate to the frontend directory
cd frontend
# Install npm dependencies
npm installThis application uses DefaultAzureCredential from the Azure Identity library for all Azure service authentication. This means:
- No API keys are stored in configuration — authentication is handled through your Azure identity.
- You must be logged in via Azure CLI before starting the backend:
az login
- Your Azure account must have the appropriate role assignments on the Azure resources (see the provisioning sections above).
DefaultAzureCredential tries multiple authentication methods in order (environment variables, managed identity, Azure CLI, etc.). For local development, it will use your az login session.
Before every demo or development session, verify your login is current:
az account show # Should display your active subscriptionIf your token has expired, run
az loginagain.
This repository includes pre-configured VS Code tasks in .vscode/tasks.json that simplify setup and startup:
| Task | What It Does |
|---|---|
| Backend: Install Python deps | Creates a virtual environment and installs requirements.txt |
| Backend: Start (uvicorn) | Activates the venv and starts the FastAPI server on port 8000 with auto-reload |
| Frontend: Install npm deps | Runs npm install in the frontend directory |
| Frontend: Start (Vite dev) | Starts the Vite development server |
To run a task: Ctrl+Shift+P (or Cmd+Shift+P on macOS) → "Tasks: Run Task" → select the task.
Tip: Use the "Full Stack" compound launch configuration (press
F5) to start both the backend and frontend simultaneously.
- Architecture Overview — Understand the system design and agent workflow
- Running the Demo — Start the application and run through a demo
- Guide: Activity Page Agents — Extend the workflow with new agents
- Guide: Text-to-Speech — Add narration capabilities