# SeqBuilderExtensions Methods

- Package: [Aspire.Hosting.Seq](/reference/api/csharp/aspire.hosting.seq.md)
- Type: [SeqBuilderExtensions](/reference/api/csharp/aspire.hosting.seq/seqbuilderextensions.md)
- Kind: `Methods`
- Members: `4`

Provides extension methods for adding Seq server resources to the application model.

## AddSeq(IDistributedApplicationBuilder, string, int?)

- Name: `AddSeq(IDistributedApplicationBuilder, string, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeqResource>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Seq/SeqBuilderExtensions.cs#L32)

Adds a Seq server resource to the application model. A container is used for local development.

```csharp
public static class SeqBuilderExtensions
{
    public static IResourceBuilder<SeqResource> AddSeq(
        this IDistributedApplicationBuilder builder,
        string name,
        int? port = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder`.
- `name` (`string`)
  The name to give the resource.
- `port` (`int?`) `optional`
  The host port for the Seq server.

## Remarks

This version of the package defaults to the tag of the container image. This overload is not available in polyglot app hosts. Use [SeqBuilderExtensions.AddSeq(IDistributedApplicationBuilder, string, int?)](/reference/api/csharp/aspire.hosting.seq/seqbuilderextensions/methods.md#addseq-idistributedapplicationbuilder-string-int) instead.

## ATS metadata

### Ignored by ATS

- Excluded from automatic Polyglot export.

## AddSeq(IDistributedApplicationBuilder, string, IResourceBuilder<ParameterResource>, int?)

- Name: `AddSeq(IDistributedApplicationBuilder, string, IResourceBuilder<ParameterResource>, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeqResource>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Seq/SeqBuilderExtensions.cs#L52-L72)

Adds a Seq server resource to the application model with authentication enabled. A container is used for local development.

```csharp
public static class SeqBuilderExtensions
{
    public static IResourceBuilder<SeqResource> AddSeq(
        this IDistributedApplicationBuilder builder,
        string name,
        IResourceBuilder<ParameterResource>? adminPassword,
        int? port = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder`.
- `name` (`string`)
  The name to give the resource.
- `adminPassword` (`IResourceBuilder<ParameterResource>`)
  The admin password for Seq. If not provided, authentication will be disabled.
- `port` (`int?`) `optional`
  The host port for the Seq server.

## Remarks

This version of the package defaults to the tag of the container image.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## WithDataBindMount(IResourceBuilder<SeqResource>, string, bool)

- Name: `WithDataBindMount(IResourceBuilder<SeqResource>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeqResource>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Seq/SeqBuilderExtensions.cs#L102-L105)

Adds a bind mount for the data folder to a Seq container resource.

```csharp
public static class SeqBuilderExtensions
{
    public static IResourceBuilder<SeqResource> WithDataBindMount(
        this IResourceBuilder<SeqResource> builder,
        string source,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeqResource>`)
  The resource builder.
- `source` (`string`)
  The source directory on the host to mount into the container.
- `isReadOnly` (`bool`) `optional`
  A flag that indicates if this is a read-only mount.

## Returns

`IResourceBuilder<SeqResource>` -- The `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## WithDataVolume(IResourceBuilder<SeqResource>, string?, bool)

- Name: `WithDataVolume(IResourceBuilder<SeqResource>, string?, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeqResource>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Seq/SeqBuilderExtensions.cs#L86-L88)

Adds a named volume for the data folder to a Seq container resource.

```csharp
public static class SeqBuilderExtensions
{
    public static IResourceBuilder<SeqResource> WithDataVolume(
        this IResourceBuilder<SeqResource> builder,
        string? name = null,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeqResource>`)
  The resource builder.
- `name` (`string?`) `optional`
  The name of the volume. Defaults to an auto-generated name based on the application and resource names.
- `isReadOnly` (`bool`) `optional`
  A flag that indicates if this is a read-only volume.

## Returns

`IResourceBuilder<SeqResource>` -- The `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
