{"record":{"id":"a6d1d09fab0b3ce2","repo":"microsoft/aspire","slug":"unable-to-add-a-seq-health-check-because-the-serverurl","errorCode":null,"errorMessage":"Unable to add a Seq health check because the 'ServerUrl' setting is missing.","messagePattern":"Unable to add a Seq health check because the 'ServerUrl' setting is missing\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Aspire.Seq/AspireSeqExtensions.cs","lineNumber":92,"sourceCode":"            _ => settings.Traces.ExportProcessorType switch\n            {\n                ExportProcessorType.Batch => new BatchActivityExportProcessor(new OtlpTraceExporter(settings.Traces)),\n                _ => new SimpleActivityExportProcessor(new OtlpTraceExporter(settings.Traces))\n            }));\n\n        if (!settings.DisableHealthChecks)\n        {\n            if (settings.ServerUrl is not null)\n            {\n                builder.TryAddHealthCheck(new HealthCheckRegistration(\n                    \"Seq\",\n                    _ => new SeqHealthCheck(settings.ServerUrl),\n                    failureStatus: default,\n                    tags: default));\n            }\n            else\n            {\n                throw new InvalidOperationException(\n                    \"Unable to add a Seq health check because the 'ServerUrl' setting is missing.\");\n            }\n        }\n\n    }\n}\n","sourceCodeStart":74,"sourceCodeEnd":99,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Components/Aspire.Seq/AspireSeqExtensions.cs#L74-L99","documentation":"Aspire registers a Seq health check pointing at the Seq server URL. If SeqSettings.ServerUrl is null/missing after configuration binding, the health check cannot be constructed and Aspire throws instead of registering a broken check.","triggerScenarios":"Calling AddSeqEndpoint when configuration provides neither a ConnectionStrings:{name} entry (which binds to ServerUrl) nor 'Aspire:Seq:ServerUrl', leaving settings.ServerUrl null.","commonSituations":"Hosting-only usage where the connection string was never injected (running app outside AppHost), renamed connection name, appsettings missing in the environment, Seq settings section deleted during refactoring.","solutions":["Provide a connection string for the connection name: ConnectionStrings:seq = http://localhost:5341.","Set 'Aspire:Seq:ServerUrl' in configuration if not using a connection string.","If using the AppHost, add .WithReference(seq) to the project so the URL is injected."],"exampleFix":"// before\nbuilder.AddSeqEndpoint(\"seq\"); // no ConnectionStrings:seq\n\n// after (appsettings.json)\n// { \"ConnectionStrings\": { \"seq\": \"http://localhost:5341\" } }\nbuilder.AddSeqEndpoint(\"seq\");","handlingStrategy":"validation","validationCode":"var seqUrl = builder.Configuration.GetConnectionString(\"seq\") ?? builder.Configuration[\"Aspire:Seq:ServerUrl\"];\nif (string.IsNullOrEmpty(seqUrl))\n    throw new InvalidOperationException(\"Seq ServerUrl missing: set ConnectionStrings:seq or Aspire:Seq:ServerUrl before AddSeqEndpoint.\");","typeGuard":null,"tryCatchPattern":"try { builder.AddSeqEndpoint(\"seq\"); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"ServerUrl\"))\n{ /* log: Seq health check skipped due to missing configuration */ }","preventionTips":["Inject the Seq URL via the AppHost (WithReference) rather than manual config when possible.","Include ConnectionStrings:seq in every environment's configuration checklist.","Validate required connection strings at startup before health check registration."],"tags":["seq","health-checks","missing-configuration","connection-string"],"backgroundTag":"missing-required-config","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}