# AzureSqlServerResource

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

## Definition

```typescript
interface AzureSqlServerResource
  extends IAzureResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithConnectionString,
    IResourceWithParameters,
    IValueProvider,
    IValueWithReferences,
    IAzureNspAssociationTarget,
    IAzurePrivateEndpointTarget,
    IAzurePrivateEndpointTargetNotification {
  readonly azureSqlDatabases: Dict<string,Aspire.Hosting.Azure.Sql/Aspire.Hosting.Azure.AzureSqlDatabaseResource>;
  readonly connectionStringExpression: ReferenceExpression;
  readonly databases: Dict<string,string>;
  readonly fullyQualifiedDomainName: BicepOutputReference;
  readonly hostName: ReferenceExpression;
  readonly id: BicepOutputReference;
  readonly isContainer: boolean;
  readonly jdbcConnectionString: ReferenceExpression;
  readonly nameOutputReference: BicepOutputReference;
  readonly port: ReferenceExpression;
  readonly uriExpression: ReferenceExpression;
  addDatabase(
      name: string,
      databaseName?: string): AzureSqlDatabaseResource;
  runAsContainer(configureContainer?: (obj: SqlServerServerResource) => Promise<void>): AzureSqlServerResource;
  withAdminDeploymentScriptStorage(storage: AzureStorageResource): AzureSqlServerResource;
  withAdminDeploymentScriptSubnet(subnet: AzureSubnetResource): AzureSqlServerResource;
}
```

## Properties

- `azureSqlDatabases`: `AzureSqlDatabaseResource>` `get` -- Gets the AzureSqlDatabases property
- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the ConnectionStringExpression property
- `databases`: `Dict<string,string>` `get` -- Gets the Databases property
- `fullyQualifiedDomainName`: `BicepOutputReference` `get` -- Gets the FullyQualifiedDomainName property
- `hostName`: `ReferenceExpression` `get` -- Gets the HostName property
- `id`: `BicepOutputReference` `get` -- Gets the Id property
- `isContainer`: `boolean` `get` -- Gets the IsContainer property
- `jdbcConnectionString`: `ReferenceExpression` `get` -- Gets the JdbcConnectionString property
- `nameOutputReference`: `BicepOutputReference` `get` -- Gets the NameOutputReference property
- `port`: `ReferenceExpression` `get` -- Gets the Port 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
  ```
- [withAdminDeploymentScriptSubnet](/reference/api/typescript/aspire.hosting.azure.sql/azuresqlserverresource/withadmindeploymentscriptsubnet.md) -- `method` -- Configures the Azure SQL server to use a specific subnet for deployment scripts
    ```typescript
  withAdminDeploymentScriptSubnet(subnet: AzureSubnetResource): AzureSqlServerResource
  ```
