# AzureSqlServerResource

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

Represents an Azure Sql Server resource.

## Definition

```go
type AzureSqlServerResource interface {
    ExpressionValue
    Resource
    ResourceWithConnectionString
}
```

## Embeds

- `ExpressionValue`
- `Resource`
- `ResourceWithConnectionString`

## Properties

- `AzureSqlDatabases`: `map[string]AzureSqlDatabaseResource` `get` -- A dictionary where the key is the resource name and the value is the Azure SQL database resource.
- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection template for the manifest for the Azure SQL Server resource.
- `Databases`: `map[string]string` `get` -- A dictionary where the key is the resource name and the value is the Azure SQL database name.
- `FullyQualifiedDomainName`: [`BicepOutputReference`](/reference/api/go/aspire.hosting.azure.sql/bicepoutputreference.md) `get` -- Gets the fully qualified domain name (FQDN) output reference from the bicep template for the Azure SQL Server resource.
- `HostName`: `*ReferenceExpression` `get` -- Gets the host name for the SQL Server.
- `Id`: [`BicepOutputReference`](/reference/api/go/aspire.hosting.azure.sql/bicepoutputreference.md) `get` -- Gets the "id" output reference for the resource.
- `IsContainer`: `bool` `get` -- Gets a value indicating whether the current resource represents a container. If so the actual resource is not running in Azure.
- `JdbcConnectionString`: `*ReferenceExpression` `get` -- Gets the JDBC connection string for the server.
- `NameOutputReference`: [`BicepOutputReference`](/reference/api/go/aspire.hosting.azure.sql/bicepoutputreference.md) `get` -- Gets the "name" output reference for the resource.
- `Port`: `*ReferenceExpression` `get` -- Gets the port for the PostgreSQL server.
- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property
- `UriExpression`: `*ReferenceExpression` `get` -- Gets the connection URI expression for the SQL Server.

## Methods

- [AddDatabase](/reference/api/go/aspire.hosting.azure.sql/azuresqlserverresource/adddatabase.md) -- `method` -- Adds an Azure SQL Database to the application model. The Free Offer option will be used when deploying the resource in Azure
  ```go
  AddDatabase(name string, options ...*AddDatabaseOptions) AzureSqlDatabaseResource
  ```
- [RunAsContainer](/reference/api/go/aspire.hosting.azure.sql/azuresqlserverresource/runascontainer.md) -- `method` -- Configures an Azure SQL Database (server) resource to run locally in a container.
  ```go
  RunAsContainer(options ...*RunAsContainerOptions) AzureSqlServerResource
  ```
- [WithAdminDeploymentScriptStorage](/reference/api/go/aspire.hosting.azure.sql/azuresqlserverresource/withadmindeploymentscriptstorage.md) -- `method` -- Configures the Azure SQL Server to use the specified storage account for deployment script execution.
  ```go
  WithAdminDeploymentScriptStorage(storage AzureStorageResource) AzureSqlServerResource
  ```
- [WithAdminDeploymentScriptSubnet](/reference/api/go/aspire.hosting.azure.sql/azuresqlserverresource/withadmindeploymentscriptsubnet.md) -- `method` -- Configures the Azure SQL Server to use the specified subnet for deployment script execution.
  ```go
  WithAdminDeploymentScriptSubnet(subnet AzureSubnetResource) AzureSqlServerResource
  ```
