microsoft/semantic-kernel · error · NotSupportedException

AI Chat service '{config.AIChatService}' is not supported.

Error message

AI Chat service '{config.AIChatService}' is not supported.

What it means

Error "AI Chat service '{config.AIChatService}' is not supported." thrown in microsoft/semantic-kernel.

Source

Thrown at dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Program.cs:102

                    });
            }
        }
        else
        {
            // Use an existing Azure OpenAI service via connection string
            chatResource = embeddingsResource = builder.AddConnectionString(HostConfig.AzureOpenAIConnectionStringName);
        }
    }

    // Add OpenAI service via connection string
    if (config.AIChatService == OpenAIChatConfig.ConfigSectionName || config.Rag.AIEmbeddingService == OpenAIEmbeddingsConfig.ConfigSectionName)
    {
        chatResource = embeddingsResource = builder.AddConnectionString(HostConfig.OpenAIConnectionStringName);
    }

    if (chatResource is null)
    {
        throw new NotSupportedException($"AI Chat service '{config.AIChatService}' is not supported.");
    }

    if (embeddingsResource is null)
    {
        throw new NotSupportedException($"AI Embedding service '{config.Rag.AIEmbeddingService}' is not supported.");
    }

    return [chatResource, embeddingsResource];
}

static IResourceBuilder<IResourceWithConnectionString> AddVectorStore(IDistributedApplicationBuilder builder, HostConfig config)
{
    switch (config.Rag.VectorStoreType)
    {
        case AzureAISearchConfig.ConfigSectionName:
        {
            return builder.ExecutionContext.IsPublishMode ?
                builder.AddAzureSearch(AzureAISearchConfig.ConnectionStringName) :

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Set AIChatService to a supported chat service value in the AppHost appsettings.
  2. Consult Program.cs in the AppHost project for the supported service names and correct the setting.

When it happens

Trigger: Thrown at dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Program.cs:102 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/48ed5d69b5ab465e. Report an issue: GitHub.