Build a Star Wars Copilot in C# - Lesson 0: Self-Setup

Jim Bennett | Jan 27, 2026

This series came from a taught workshop, so some original steps assumed resources were already provisioned by an instructor.

If you’re following along on your own, this lesson gets you set up so lessons 1-8 work end-to-end.

Consider this your opening crawl: over this series, you’ll learn to build your own Star Wars-inspired copilot, one lesson at a time.

The workshop itself is a hands-on build where you create a Star Wars-themed copilot in C#, step by step, using modern Azure AI tooling.

Aim: build a production-style AI app architecture, not just a one-off chatbot demo.

Goals:

  • start with a basic chat loop using Microsoft.Extensions.AI
  • add memory, prompts, and model flexibility (cloud + local)
  • expand with tools, MCP servers, and retrieval from data
  • add multimodal image generation and agent orchestration
  • finish with a reusable, composable architecture you can adapt to real workloads

Lessons in this series

Lesson
Lesson 0: Self-Setup
Lesson 1: Chat with an LLM
Lesson 2: Chat History and System Prompts
Lesson 3: Model Choice and Local Models
Lesson 4: Tool Calling
Lesson 5: MCP (Model Context Protocol)
Lesson 6: RAG from a Database
Lesson 7: Multimodal Image Generation
Lesson 8: Agents and Orchestration

What you’ll set up

  • local dev tooling (git, .NET 10 SDK, optional Node.js for MCP Inspector)
  • Azure OpenAI chat deployment
  • optional Azure AI Inference endpoint
  • Tavily API key (lesson 4)
  • Azure Storage Tables + sample data (lesson 6)
  • Azure OpenAI image deployment (lesson 7)

Local tooling

Install and verify:

git --version
dotnet --version

For MCP Inspector in lesson 5, also install Node.js and verify:

node --version
npx --version

Clone the workshop source

git clone https://github.com/jimbobbennett/StarWarsCopilot.git
cd StarWarsCopilot

Azure account and cost guardrails

You’ll need:

  • an active Azure subscription
  • permission to create Azure OpenAI and Storage resources
  • a spending plan (this series uses billable services)

My recommendation:

  • use a dedicated resource group for this series
  • set a budget/alert on that resource group
  • only deploy the models you need for the current lesson

Azure OpenAI baseline (lesson 1)

  1. Create an Azure OpenAI resource in a supported region.
  2. Deploy a chat model (for example gpt-5-mini).
  3. Copy endpoint, API key, and deployment name.

In your copilot project:

dotnet user-secrets init
dotnet user-secrets set "OpenAI:Endpoint" "https://<your-resource>.openai.azure.com"
dotnet user-secrets set "OpenAI:APIKey" "<your-api-key>"
dotnet user-secrets set "OpenAI:ModelName" "<your-chat-deployment-name>"

Optional: Azure AI Inference + Foundry Local (lesson 3)

If you want to test alternative models via Azure AI Inference:

dotnet user-secrets set "AIInference:Endpoint" "https://<your-foundry-project>.services.ai.azure.com/models"
dotnet user-secrets set "AIInference:ModelName" "<your-inference-model-name>"

If you want local/offline execution, install Foundry Local and test:

foundry model download phi-4-mini
foundry model run phi-4-mini

Tavily key (lesson 4)

Create a Tavily account and set:

dotnet user-secrets set "Tavily:ApiKey" "<your-tavily-api-key>"

Azure Storage Tables (lesson 6)

Create a Storage account and set:

dotnet user-secrets set "AzureStorage:ConnectionString" "<your-storage-connection-string>"

Create these tables:

  • Figurines
  • Orders
  • OrderFigurines

Then seed sample rows using the workshop dataloader (6-rag/dataloader) or Storage Explorer.

Image deployment (lesson 7)

Deploy a GPT image model (for example gpt-image-1 or gpt-image-1.5) in Azure OpenAI and set:

dotnet user-secrets set "ImageGeneration:Endpoint" "https://<your-resource>.openai.azure.com/"
dotnet user-secrets set "ImageGeneration:APIKey" "<your-api-key>"
dotnet user-secrets set "ImageGeneration:ModelName" "<your-image-deployment-name>"

Also worth noting: dall-e-3 has been retired in Azure OpenAI, so use the gpt-image-1 model family for new deployments.

Quick readiness check

Before starting lesson 1, run:

dotnet user-secrets list

You should see at least:

  • OpenAI:Endpoint
  • OpenAI:APIKey
  • OpenAI:ModelName

Add and verify the other secrets as you reach each lesson.

Cleanup when you’re done

To avoid surprise costs:

  • delete model deployments you no longer need
  • delete the workshop Storage account
  • delete the workshop resource group
  • rotate/revoke any API keys created for exercises

You’re ready for lesson 1.

Note: Original workshop repository: jimbobbennett/StarWarsCopilot.