Zum Inhalt springen

Seq hosting integration

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Seq logo

The Seq hosting integration models a Seq resource as the SeqResource type. To access this type and APIs, add the 📦 Aspire.Hosting.Seq NuGet package in your AppHost project:

Aspire CLI — Aspire.Hosting.Seq Paket hinzufügen
aspire add seq

Die Aspire CLI ist interaktiv; das passende Suchergebnis wählen, wenn gefragt:

Aspire CLI — Beispielausgabe
Select an integration to add:
> seq (Aspire.Hosting.Seq)
> Other results listed as selectable options...

In your AppHost project, call AddSeq to add and return a Seq resource builder:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var seq = builder.AddSeq("seq")
.ExcludeFromManifest()
.WithLifetime(ContainerLifetime.Persistent)
.WithEnvironment("ACCEPT_EULA", "Y");
var myService = builder.AddProject<Projects.ExampleProject>()
.WithReference(seq)
.WaitFor(seq);

Accept the Seq End User License Agreement (EULA)

Section titled “Accept the Seq End User License Agreement (EULA)”

You must accept the Seq EULA for Seq to start. To accept the agreement in code, pass the environment variable ACCEPT_EULA to the Seq container, and set its value to Y.

Seq shouldn’t be part of the Aspire deployment manifest, hence the chained call to ExcludeFromManifest. It’s recommended you set up a secure production Seq server outside of Aspire for your production environment.

To add a data volume to the Seq resource, call the WithDataVolume method:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var seq = builder.AddSeq("seq")
.WithDataVolume()
.ExcludeFromManifest()
.WithLifetime(ContainerLifetime.Persistent);
var myService = builder.AddProject<Projects.ExampleProject>()
.WithReference(seq)
.WaitFor(seq);

The data volume is used to persist the Seq data outside the lifecycle of its container.