microsoft/semantic-kernel · error · NotSupportedException
AI service '{config.Rag.AIEmbeddingService}' is not supporte
Error message
AI service '{config.Rag.AIEmbeddingService}' is not supported. What it means
Error "AI service '{config.Rag.AIEmbeddingService}' is not supported." thrown in microsoft/semantic-kernel.
Source
Thrown at dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Extensions/ResourceBuilderExtensions.cs:67
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:
{
builder.WithEnvironment($"{HostConfig.AIServicesSectionName}__{nameof(config.OpenAIEmbeddings)}__{nameof(config.OpenAIEmbeddings.ModelName)}", config.OpenAIEmbeddings.ModelName);
break;
}
default:
throw new NotSupportedException($"AI service '{config.Rag.AIEmbeddingService}' is not supported.");
}
return builder;
}
/// <summary>
/// Adds connection strings of source resources to a destination resource.
/// </summary>
/// <typeparam name="T">The type of the destination resource.</typeparam>
/// <param name="builder">The destination resource.</param>
/// <param name="resources">The source resource with the connection string.</param>
/// <returns>The updated resource builder.</returns>
public static IResourceBuilder<T> WithReferences<T>(this IResourceBuilder<T> builder, IList<IResourceBuilder<IResourceWithConnectionString>> resources) where T : IResourceWithEnvironment
{
ArgumentNullException.ThrowIfNull(builder);
ArgumentNullException.ThrowIfNull(resources);
foreach (var resource in resources)View on GitHub (pinned to c028a0c7dc)
Solutions
- Configure Rag:AIEmbeddingService with a supported embedding service name.
- Check the supported values in ResourceBuilderExtensions.cs and fix the configuration entry.
When it happens
Trigger: Thrown at dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Extensions/ResourceBuilderExtensions.cs:67 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/d64770af6b275f3a.
Report an issue: GitHub.