# SqlServerServerResource.WithDataBindMount

- Module: [Aspire.Hosting.SqlServer](/reference/api/go/aspire.hosting.sqlserver.md)
- Defined on: [SqlServerServerResource](/reference/api/go/aspire.hosting.sqlserver/sqlserverserverresource.md)
- Version: `17.0.0`
- Kind: `method`

Adds a bind mount for the data folder to a SQL Server resource.

## Remarks

The container starts up as non-root and the `source` directory must be readable by the user that the container runs as.
https://learn.microsoft.com/sql/linux/sql-server-linux-docker-container-configure?view=sql-server-ver16&pivots=cs1-bash#mount-a-host-directory-as-data-volume

## Definition

```go
type SqlServerServerResource interface {
    // ... omitted for brevity
    WithDataBindMount(
        source string,
        options ...*WithDataBindMountOptions,
    ) SqlServerServerResource
}
```

## Signature

```go
WithDataBindMount(
    source string,
    options ...*WithDataBindMountOptions,
) SqlServerServerResource
```

## Parameters

- `source` (`string`) -- The source directory on the host to mount into the container.
- `options` (`...*WithDataBindMountOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithDataBindMountOptions` argument.

- `IsReadOnly` (`*bool`) -- A flag that indicates if this is a read-only mount.

## Returns

[`SqlServerServerResource`](/reference/api/go/aspire.hosting.sqlserver/sqlserverserverresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [SqlServerServerResource](/reference/api/go/aspire.hosting.sqlserver/sqlserverserverresource.md) -- `handle`
