{"record":{"id":"c25bd7a0feb32f89","repo":"microsoft/semantic-kernel","slug":"either-a2aserver-apikey-or-a2aserver-connectionstr","errorCode":null,"errorMessage":"Either A2AServer:ApiKey or A2AServer:ConnectionString & agentId must be provided","messagePattern":"Either A2AServer:ApiKey or A2AServer:ConnectionString & agentId must be provided","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"dotnet/samples/Demos/A2AClientServer/A2AServer/Program.cs","lineNumber":96,"sourceCode":"            template.\"\n            \"\"\", invoicePlugins),\n        \"LOGISTICS\" => await HostAgentFactory.CreateChatCompletionHostAgentAsync(\n            agentType, modelId, apiKey, \"LogisticsAgent\",\n            \"\"\"\n            You specialize in handling queries related to logistics.\n            \n            Always reply with exactly:\n            \n            Shipment number: SHPMT-SAP-001\n            Item: TSHIRT-RED-L\n            Quantity: 900\n            \"\"\", invoicePlugins),\n        _ => throw new ArgumentException($\"Unsupported agent type: {agentType}\"),\n    };\n}\nelse\n{\n    throw new ArgumentException(\"Either A2AServer:ApiKey or A2AServer:ConnectionString & agentId must be provided\");\n}\n\napp.MapA2A(hostAgent!.TaskManager!, \"/\");\napp.MapWellKnownAgentCard(hostAgent!.TaskManager!, \"/\");\n\nawait app.RunAsync();\n","sourceCodeStart":78,"sourceCodeEnd":103,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/samples/Demos/A2AClientServer/A2AServer/Program.cs#L78-L103","documentation":"Error \"Either A2AServer:ApiKey or A2AServer:ConnectionString & agentId must be provided\" thrown in microsoft/semantic-kernel.","triggerScenarios":"Thrown at dotnet/samples/Demos/A2AClientServer/A2AServer/Program.cs:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide A2AServer:ApiKey in configuration, or provide both A2AServer:ConnectionString and the agentId value.","Check appsettings.json / user secrets for the 'A2AServer' section and fill in the missing keys."],"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"}