{"record":{"id":"b46308a35f56cda1","repo":"microsoft/aspire","slug":"unknown-publish-summary-scenario-scenariokey","errorCode":null,"errorMessage":"Unknown publish summary scenario '{scenarioKey}'.","messagePattern":"Unknown publish summary scenario '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Commands/RenderCommand.cs","lineNumber":551,"sourceCode":"            ]),\n        \"publish-summary-markdown-values\" => new(\n            \"Markdown in pipeline summary values\",\n            [\n                new(\"root\", \"Deploy to Azure\", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(30), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromSeconds(30)),\n                new(\"provision\", \"Provision resources\", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(18), null, \"root\", 1, 2, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(20)),\n                new(\"configure\", \"Configure endpoints\", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(8), null, \"root\", 1, 3, TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(28)),\n            ],\n            PipelineSummary:\n            [\n                new() { Key = \"Endpoint\", Value = \"Application deployed to [https://myapp.azurecontainerapps.io](https://myapp.azurecontainerapps.io)\", EnableMarkdown = true },\n                new() { Key = \"Dashboard\", Value = \"View resources at [Azure Portal](https://portal.azure.com/#view/resource/123)\", EnableMarkdown = true },\n                new() { Key = \"API Docs\", Value = \"See the **API reference** at [docs](https://learn.microsoft.com/aspire) for more info\", EnableMarkdown = true },\n                new() { Key = \"Connection String\", Value = \"`Server=tcp:myserver.database.windows.net;Database=mydb`\", EnableMarkdown = true },\n                new() { Key = \"Region\", Value = \"East US 2\", EnableMarkdown = false },\n                new() { Key = \"Resource Group\", Value = \"rg-myapp-prod\", EnableMarkdown = false },\n                new() { Key = \"Next Steps\", Value = \"Run `aspire publish --env staging` to deploy to **staging**, or visit [the docs](https://learn.microsoft.com/aspire/deployment) for more options.\", EnableMarkdown = true },\n            ]),\n        _ => throw new InvalidOperationException($\"Unknown publish summary scenario '{scenarioKey}'.\")\n    };\n\n    private sealed record PublishSummaryRenderScenario(\n        string Title,\n        IReadOnlyList<ConsoleActivityLogger.StepDurationRecord> Records,\n        bool Succeeded = true,\n        IReadOnlyList<BackchannelPipelineSummaryItem>? PipelineSummary = null);\n\n    private TestPipelineCommand CreateTestPipelineCommand() => new(\n        _serviceProvider.GetRequiredService<IDotNetCliRunner>(),\n        _serviceProvider.GetRequiredService<IProjectLocator>(),\n        _serviceProvider.GetRequiredService<IFeatures>(),\n        _hostEnvironment,\n        _serviceProvider.GetRequiredService<IAppHostProjectFactory>(),\n        _serviceProvider.GetRequiredService<IConfiguration>(),\n        _serviceProvider.GetRequiredService<ILogger<RenderCommand>>(),\n        _ansiConsole,\n        _serviceProvider.GetRequiredService<CommonCommandServices>());","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Commands/RenderCommand.cs#L533-L569","documentation":"RenderCommand's TestPublishSummary renderer switches over a hardcoded set of scenario keys to produce sample publish-summary output. An unrecognized scenarioKey hits the switch's default arm, which throws this InvalidOperationException because the scenario table is closed.","triggerScenarios":"Invoking the internal render/preview entry point (e.g. `aspire render ...` developer/scenario flag) with a scenario name that is not one of the defined publish-summary scenarios.","commonSituations":"Typo in a scenario key on the command line; contributor added a scenario caller without adding the matching switch arm; stale docs listing a removed scenario.","solutions":["Use one of the supported scenario keys (check RenderCommand's switch in CreatePublishSummaryScenario)","Fix the typo in the scenario argument","If adding a new scenario, add the corresponding switch arm in CreatePublishSummaryScenario"],"exampleFix":"// before\nrender --scenario publish-sucess\n// after\nrender --scenario publish-success","handlingStrategy":"validation","validationCode":"var known = new[] { \"publish-success\", \"publish-failure\", /* all supported keys */ };\nif (!known.Contains(scenarioKey))\n    throw new ArgumentException($\"Unknown scenario '{scenarioKey}'.\");","typeGuard":null,"tryCatchPattern":"try { RenderPublishSummary(scenarioKey); }\ncatch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Unknown publish summary scenario\")) { Console.Error.WriteLine(\"Supported: <list keys>\"); }","preventionTips":["List available scenario keys in help output","Use constants/enum instead of raw strings for scenario keys","Add a test that iterates all documented scenario keys"],"tags":["cli","render","scenario"],"backgroundTag":"invalid-argument-value","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}