# AzureSqlServerResource

- 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 AzureSqlServerResource
  extends IAzureResource,
    IManifestExpressionProvider,
    IResource,
    IResourceWithConnectionString,
    IResourceWithParameters,
    IValueProvider,
    IValueWithReferences,
    IAzurePrivateEndpointTarget,
    IAzurePrivateEndpointTargetNotification {
  readonly connectionStringExpression: ReferenceExpression;
  readonly databases: Dict<string,string>;
  readonly hostName: ReferenceExpression;
  readonly isContainer: boolean;
  readonly jdbcConnectionString: ReferenceExpression;
  readonly name: string;
  readonly outputs: Dict<string,any>;
  readonly parameters: Dict<string,any>;
  readonly port: ReferenceExpression;
  readonly secretOutputs: Dict<string,string>;
  readonly uriExpression: ReferenceExpression;
  addDatabase(
      name: string,
      databaseName?: string): AzureSqlDatabaseResource;
  runAsContainer(configureContainer?: (obj: SqlServerServerResource) => Promise<void>): AzureSqlServerResource;
  withAdminDeploymentScriptStorage(storage: AzureStorageResource): AzureSqlServerResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the ConnectionStringExpression property
- `databases`: `Dict<string,string>` `get` -- Gets the Databases property
- `hostName`: `ReferenceExpression` `get` -- Gets the HostName property
- `isContainer`: `boolean` `get` -- Gets the IsContainer property
- `jdbcConnectionString`: `ReferenceExpression` `get` -- Gets the JdbcConnectionString property
- `name`: `string` `get` -- Gets the Name property
- `outputs`: `Dict<string,any>` `get` -- Gets the Outputs property
- `parameters`: `Dict<string,any>` `get` -- Gets the Parameters property
- `port`: `ReferenceExpression` `get` -- Gets the Port property
- `secretOutputs`: `Dict<string,string>` `get` -- Gets the SecretOutputs property
- `uriExpression`: `ReferenceExpression` `get` -- Gets the UriExpression property

## Methods

- [addDatabase](/reference/api/typescript/aspire.hosting.azure.sql/azuresqlserverresource/adddatabase.md) -- `method` -- Adds an Azure SQL database resource
    ```typescript
  addDatabase(name: string, databaseName?: string): AzureSqlDatabaseResource
  ```
- [runAsContainer](/reference/api/typescript/aspire.hosting.azure.sql/azuresqlserverresource/runascontainer.md) -- `method` -- Configures the Azure SQL server to run locally in a SQL Server container
    ```typescript
  runAsContainer(configureContainer?: (obj: SqlServerServerResource) => Promise<void>): AzureSqlServerResource
  ```
- [withAdminDeploymentScriptStorage](/reference/api/typescript/aspire.hosting.azure.sql/azuresqlserverresource/withadmindeploymentscriptstorage.md) -- `method` -- Configures the Azure SQL server to use a specific storage account for deployment scripts
    ```typescript
  withAdminDeploymentScriptStorage(storage: AzureStorageResource): AzureSqlServerResource
  ```
