Seq hosting integration
Este conteúdo não está disponível em sua língua ainda.
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 add seqA CLI Aspire é interativa; escolhe o resultado apropriado quando solicitado:
Select an integration to add:
> seq (Aspire.Hosting.Seq)> Other results listed as selectable options...#:package Aspire.Hosting.Seq@*<PackageReference Include="Aspire.Hosting.Seq" Version="*" />Add a Seq resource
Section titled “Add a Seq resource”In your AppHost project, call AddSeq to add and return a Seq resource builder:
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 in the Aspire manifest
Section titled “Seq in the Aspire manifest”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.
Add a Seq resource with a data volume
Section titled “Add a Seq resource with a data volume”To add a data volume to the Seq resource, call the WithDataVolume method:
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.