Skip to content
| Marketplace
Sign in
Visual Studio>Templates>Semantic Kernel Web API Quick-Start
Semantic Kernel Web API Quick-Start

Semantic Kernel Web API Quick-Start

GoodToCode

|
361 installs
| (1) | Free
Semantic Kernel Quick-Start for Web API clean architecture microservice includes common use cases of Semantic Kernel in a Clean Architecture Microservice. Chat Completion, Text Generation, Text to Audio, Text to Image. A simple Semantic Kernel CRUD Microservice solution includ...
Download

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.

Semantic Kernel Quick-Start Web API


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

  1. Install the Template
    • Download and install from the Visual Studio Marketplace.
    • In Visual Studio: File → New Project → Semantic Kernel Quick-Start
  2. 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
    
    • SQL Server (Express or Developer Edition)
  3. Configure Entra External ID (EEID) Authentication (see below)
  4. 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"
    
  5. 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"
    
  6. 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.


  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft