# SqlServerServerResource

- Module: [Aspire.Hosting.Azure.Sql](/reference/api/typescript/aspire.hosting.azure.sql.md)
- Version: `13.2.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

## Definition

```typescript
interface SqlServerServerResource
  extends IComputeResource,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly databases: Dict<string,string>;
  entrypoint: string;
  readonly host: EndpointReferenceExpression;
  readonly jdbcConnectionString: ReferenceExpression;
  readonly name: string;
  passwordParameter: ParameterResource;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  shellExecution: boolean;
  readonly uriExpression: ReferenceExpression;
  readonly userNameReference: ReferenceExpression;
  addDatabase(
      name: string,
      databaseName?: string): SqlServerDatabaseResource;
  withDataBindMount(
      source: string,
      isReadOnly?: boolean): SqlServerServerResource;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): SqlServerServerResource;
  withHostPort(port: number): SqlServerServerResource;
  withPassword(password: ParameterResource): SqlServerServerResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the ConnectionStringExpression property
- `databases`: `Dict<string,string>` `get` -- Gets the Databases property
- `entrypoint`: `string` `get - set` -- Gets the Entrypoint property
- `host`: `EndpointReferenceExpression` `get` -- Gets the Host property
- `jdbcConnectionString`: `ReferenceExpression` `get` -- Gets the JdbcConnectionString property
- `name`: `string` `get` -- Gets the Name property
- `passwordParameter`: `ParameterResource` `get - set` -- Gets the PasswordParameter property
- `port`: `EndpointReferenceExpression` `get` -- Gets the Port property
- `primaryEndpoint`: `EndpointReference` `get` -- Gets the PrimaryEndpoint property
- `shellExecution`: `boolean` `get - set` -- Gets the ShellExecution property
- `uriExpression`: `ReferenceExpression` `get` -- Gets the UriExpression property
- `userNameReference`: `ReferenceExpression` `get` -- Gets the UserNameReference property

## Methods

- [addDatabase](/reference/api/typescript/aspire.hosting.azure.sql/sqlserverserverresource/adddatabase.md) -- `method` -- Adds a SQL Server database resource
    ```typescript
  addDatabase(name: string, databaseName?: string): SqlServerDatabaseResource
  ```
- [withDataBindMount](/reference/api/typescript/aspire.hosting.azure.sql/sqlserverserverresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the SQL Server data folder
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): SqlServerServerResource
  ```
- [withDataVolume](/reference/api/typescript/aspire.hosting.azure.sql/sqlserverserverresource/withdatavolume.md) -- `method` -- Adds a named volume for the SQL Server data folder
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): SqlServerServerResource
  ```
- [withHostPort](/reference/api/typescript/aspire.hosting.azure.sql/sqlserverserverresource/withhostport.md) -- `method` -- Sets the host port for the SQL Server resource
    ```typescript
  withHostPort(port: number): SqlServerServerResource
  ```
- [withPassword](/reference/api/typescript/aspire.hosting.azure.sql/sqlserverserverresource/withpassword.md) -- `method` -- Configures the password for the SQL Server resource
    ```typescript
  withPassword(password: ParameterResource): SqlServerServerResource
  ```
