{"record":{"id":"d538d2f59ee9689e","repo":"microsoft/semantic-kernel","slug":"ai-service-config-aichatservice-is-not-support","errorCode":null,"errorMessage":"AI service '{config.AIChatService}' is not supported.","messagePattern":"AI service '(.+?)' is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Extensions/ResourceBuilderExtensions.cs","lineNumber":43,"sourceCode":"        builder.WithEnvironment(nameof(config.AIChatService), config.AIChatService);\n\n        switch (config.AIChatService)\n        {\n            case AzureOpenAIChatConfig.ConfigSectionName:\n            {\n                builder.WithEnvironment($\"{HostConfig.AIServicesSectionName}__{nameof(config.AzureOpenAIChat)}__{nameof(config.AzureOpenAIChat.DeploymentName)}\", config.AzureOpenAIChat.DeploymentName);\n                builder.WithEnvironment($\"{HostConfig.AIServicesSectionName}__{nameof(config.AzureOpenAIChat)}__{nameof(config.AzureOpenAIChat.ModelName)}\", config.AzureOpenAIChat.ModelName);\n                break;\n            }\n\n            case OpenAIChatConfig.ConfigSectionName:\n            {\n                builder.WithEnvironment($\"{HostConfig.AIServicesSectionName}__{nameof(config.OpenAIChat)}__{nameof(config.OpenAIChat.ModelName)}\", config.OpenAIChat.ModelName);\n                break;\n            }\n\n            default:\n                throw new NotSupportedException($\"AI service '{config.AIChatService}' is not supported.\");\n        }\n\n        // Add RAG configuration to the environment variables so that Api Service can access it.\n        builder.WithEnvironment($\"{nameof(config.Rag)}__{nameof(config.Rag.AIEmbeddingService)}\", config.Rag.AIEmbeddingService);\n        builder.WithEnvironment($\"{nameof(config.Rag)}__{nameof(config.Rag.VectorStoreType)}\", config.Rag.VectorStoreType);\n        builder.WithEnvironment($\"{nameof(config.Rag)}__{nameof(config.Rag.CollectionName)}\", config.Rag.CollectionName);\n\n        switch (config.Rag.AIEmbeddingService)\n        {\n            case AzureOpenAIEmbeddingsConfig.ConfigSectionName:\n            {\n                builder.WithEnvironment($\"{HostConfig.AIServicesSectionName}__{nameof(config.AzureOpenAIEmbeddings)}__{nameof(config.AzureOpenAIEmbeddings.DeploymentName)}\", config.AzureOpenAIEmbeddings.DeploymentName);\n                builder.WithEnvironment($\"{HostConfig.AIServicesSectionName}__{nameof(config.AzureOpenAIEmbeddings)}__{nameof(config.AzureOpenAIEmbeddings.ModelName)}\", config.AzureOpenAIEmbeddings.ModelName);\n                break;\n            }\n\n            case OpenAIEmbeddingsConfig.ConfigSectionName:\n            {","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Extensions/ResourceBuilderExtensions.cs#L25-L61","documentation":"Error \"AI service '{config.AIChatService}' is not supported.\" thrown in microsoft/semantic-kernel.","triggerScenarios":"Thrown at dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/Extensions/ResourceBuilderExtensions.cs:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}