microsoft/semantic-kernel · error · NotSupportedException
AI service '{config.AIChatService}' is not supported.
Error message
AI service '{config.AIChatService}' is not supported. What it means
Error "AI service '{config.AIChatService}' is not supported." thrown in microsoft/semantic-kernel.
Source
Thrown at dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Extensions/ResourceBuilderExtensions.cs:43
builder.WithEnvironment(nameof(config.AIChatService), config.AIChatService);
switch (config.AIChatService)
{
case AzureOpenAIChatConfig.ConfigSectionName:
{
builder.WithEnvironment($"{HostConfig.AIServicesSectionName}__{nameof(config.AzureOpenAIChat)}__{nameof(config.AzureOpenAIChat.DeploymentName)}", config.AzureOpenAIChat.DeploymentName);
builder.WithEnvironment($"{HostConfig.AIServicesSectionName}__{nameof(config.AzureOpenAIChat)}__{nameof(config.AzureOpenAIChat.ModelName)}", config.AzureOpenAIChat.ModelName);
break;
}
case OpenAIChatConfig.ConfigSectionName:
{
builder.WithEnvironment($"{HostConfig.AIServicesSectionName}__{nameof(config.OpenAIChat)}__{nameof(config.OpenAIChat.ModelName)}", config.OpenAIChat.ModelName);
break;
}
default:
throw new NotSupportedException($"AI service '{config.AIChatService}' is not supported.");
}
// Add RAG configuration to the environment variables so that Api Service can access it.
builder.WithEnvironment($"{nameof(config.Rag)}__{nameof(config.Rag.AIEmbeddingService)}", config.Rag.AIEmbeddingService);
builder.WithEnvironment($"{nameof(config.Rag)}__{nameof(config.Rag.VectorStoreType)}", config.Rag.VectorStoreType);
builder.WithEnvironment($"{nameof(config.Rag)}__{nameof(config.Rag.CollectionName)}", config.Rag.CollectionName);
switch (config.Rag.AIEmbeddingService)
{
case AzureOpenAIEmbeddingsConfig.ConfigSectionName:
{
builder.WithEnvironment($"{HostConfig.AIServicesSectionName}__{nameof(config.AzureOpenAIEmbeddings)}__{nameof(config.AzureOpenAIEmbeddings.DeploymentName)}", config.AzureOpenAIEmbeddings.DeploymentName);
builder.WithEnvironment($"{HostConfig.AIServicesSectionName}__{nameof(config.AzureOpenAIEmbeddings)}__{nameof(config.AzureOpenAIEmbeddings.ModelName)}", config.AzureOpenAIEmbeddings.ModelName);
break;
}
case OpenAIEmbeddingsConfig.ConfigSectionName:
{View on GitHub (pinned to c028a0c7dc)
Solutions
- Configure AIChatService with a supported service name in the AppHost configuration.
- Review ResourceBuilderExtensions.cs for the supported AI service types and update the configuration value.
When it happens
Trigger: Thrown at dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Extensions/ResourceBuilderExtensions.cs:43 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/d538d2f59ee9689e.
Report an issue: GitHub.