Code Examples

Explore interactive examples demonstrating various features and integrations.

Auth0 with Blazor Server
Order: 2

Integration Auth0 with Blazor Server is straightforward. This example demonstrates the necessary steps to set up authentication and authorization using Auth0 in a Blazor Server application. Follow the steps below to get started.

Azure AI Chat Bot
Order: 3

Chat with Jaws - ask about the weather anywhere, or for a joke.

AI Fortune Cookie
Order: 4

Crack open an AI-written fortune with lucky numbers, then browse your fortune history.

Code Editor Demo
Order: 10

The Monaco editor is an open source text editor created by Microsoft and used in VSCode. Monaco provides support for multiple programming languages including C#, JavaScript, and SQL.

Code Highlighting Example
Order: 10

Demonstrates syntax highlighting for C#, SQL, Blazor, and PowerShell using the HTML <code> tag and Prism.js.

Real-Time Mouse Tracking
Order: 10

Real-time collaborative mouse tracking using SignalR. See other users' mouse cursors as they move around the page.

Interactive Maps
Order: 12

Leaflet + OpenStreetMap maps with markers, clustering, layer toggles, and click-to-place pin picking - no API key, no billing.

Real-time Synchronization
Order: 20

Demonstrates SignalR-based real-time state synchronization with automatic master election, live counters, and synchronized interactions across multiple browser sessions.

Agent Framework
Agent Framework: Basic Setup
Order: 5

The smallest possible Microsoft Agent Framework setup: one shared AIAgent, one RunAsync call.

Agent Framework: Azure AI Foundry Integration
Order: 6

How this site's AIAgent is actually backed by an Azure AI Foundry project, and what that buys you.

Agent Framework: Conversational Chat
Order: 7

The minimum code needed for multi-turn, streaming chat with the Agent Framework - no model picker, no chrome.

Agent Framework: MCP Servers
Order: 8

The general shape of MCP servers and clients in the Agent Framework - hosting tools and calling them.


Quick Navigation

Auth0 with Blazor Server

/examples/auth0-blazor-server-integration
2

Azure AI Chat Bot

/examples/azure-openai-chat-bot
3

AI Fortune Cookie

/examples/ai-fortune-cookie
4

Agent Framework: Basic Setup

/examples/agent-framework-basics
Agent Framework
5

Agent Framework: Azure AI Foundry Integration

/examples/agent-framework-foundry
Agent Framework
6

Agent Framework: Conversational Chat

/examples/agent-framework-chat
Agent Framework
7

Agent Framework: MCP Servers

/examples/agent-framework-mcp
Agent Framework
8

Code Editor Demo

/examples/code-editor
10

Code Highlighting Example

/examples/code-highlighting
10

Real-Time Mouse Tracking

/examples/mouse-tracking
10

Interactive Maps

/examples/map
12

Real-time Synchronization

/examples/realtime-sync
20

An unhandled error has occurred. Reload 🗙