Semantic Kernel Quick-Start for Web API
Build AI-powered Web API services in minutes with Microsoft Semantic Kernel!
Semantic Kernel Quick-Start for Web API is a Visual Studio template for rapidly building C# Web API apps with integrated AI features. It provides a ready-to-use ASP.NET Web API service, demonstrating chat, text generation, text-to-audio, and text-to-image—all persisted to SQL Server.

Why Use This Template?
- Instant AI integration: Start with a working Web API app wired for Semantic Kernel and Azure OpenAI.
- Copilot-style chat UI: Modern conversational interface out of the box.
- Production patterns: Clean architecture, extensible plugin system, and SQL persistence.
Getting Started
- Install the Template
- Download and install from the Visual Studio Marketplace.
- In Visual Studio: File → New Project → Semantic Kernel Quick-Start
- Install Prerequisites
winget install Microsoft.VisualStudio.2022.Community --override "--quiet --add Microsoft.Visualstudio.Workload.Azure --add Microsoft.VisualStudio.Workload.Data --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb"
winget install Microsoft.DotNet.SDK.10 --silent
dotnet tool install --global dotnet-ef
- Configure Entra External ID (EEID) Authentication (see below)
- Add your OpenAI or Azure OpenAI key
cd Presentation.WebApi
dotnet user-secrets set "OpenAI:ApiKey" "YOUR_API_KEY"
cd ../Tests.Specs.Integration
dotnet user-secrets set "OpenAI:ApiKey" "YOUR_API_KEY"
- Create your SQL Server database & schema
cd ../
dotnet ef database update --project ./Infrastructure.SqlServer/Infrastructure.SqlServer.csproj --startup-project ./Presentation.WebApi/Presentation.WebApi.csproj --context SemanticKernelContext --connection "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=SemanticKernel;Min Pool Size=3;MultipleActiveResultSets=True;Trusted_Connection=Yes;TrustServerCertificate=True;Encrypt=True;Connection Timeout=30"
- Run the Web API
dotnet run --project Presentation.WebApi/Presentation.WebApi.csproj
Features
- Chat Completions: Generate responses to user input (chatbots, assistants)
- Text to Speech & Speech to Text: Natural language input/output
- Image to Text & Text to Image: Describe images or generate images from prompts
- Extensible Plugins: Add your own skills and integrations
Planned features: Embeddings, function calling, content filtering, fine-tuning, assistants, semantic search
EEID Authentication (Required)
This project uses Entra External ID (EEID) for authentication. Complete ONE of the following:
1. Scripted setup (recommended):
pwsh -File ./.azure/scripts/entra/New-EntraAppRegistrations.ps1 -EntraInstanceUrl "https://your-tenant-name.ciamlogin.com" -TenantId "<your-tenant-id>" -WebAppRegistrationName "myproduct-web-dev-001" -ApiAppRegistrationName "myproduct-api-dev-001" -ApiProjectPath "../../src/Presentation.WebApi"
Follow prompts to grant admin consent in Azure Portal.
2. Use existing app registration (will read registration to set dotnet user-secrets):
pwsh -File ./.azure/scripts/entra/Set-ApiAppUserSecrets.ps1 -TenantId "<your-tenant-id>" -ApiAppRegistrationName "myproduct-api-dev-001" -ApiProjectPath "../../src/Presentation.WebApi"
3. Manual setup:
cd src/Presentation.WebApi
dotnet user-secrets init
dotnet user-secrets set "EntraExternalId:Instance" "https://your-tenant-name.ciamlogin.com"
dotnet user-secrets set "EntraExternalId:TenantId" "<your-tenant-id>"
dotnet user-secrets set "EntraExternalId:ClientId" "<api-app-client-id>"
dotnet user-secrets set "EntraExternalId:ValidateAuthority" "true"
Add web client/secret as needed.