# AzureSqlDatabaseResource Properties

- Package: [Aspire.Hosting.Azure.Sql](/reference/api/csharp/aspire.hosting.azure.sql.md)
- Type: [AzureSqlDatabaseResource](/reference/api/csharp/aspire.hosting.azure.sql/azuresqldatabaseresource.md)
- Kind: `Properties`
- Members: `7`

A resource that represents an Azure SQL database. This is a child resource of an [AzureSqlServerResource](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource.md).

## Annotations

- Name: `Annotations`
- Modifiers: `override` `get`
- Returns: `ResourceAnnotationCollection`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlDatabaseResource.cs#L88)

```csharp
public override ResourceAnnotationCollection Annotations { get; }
```

## Remarks

This property is not available in polyglot app hosts.

## ATS metadata

### Ignored by ATS

- Excluded from automatic Polyglot export.

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlDatabaseResource.cs#L37)

Gets the connection string expression for the Azure SQL database.

```csharp
public ReferenceExpression ConnectionStringExpression { get; }
```

## DatabaseName

- Name: `DatabaseName`
- Modifiers: `get`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlDatabaseResource.cs#L42)

Gets the database name.

```csharp
public string DatabaseName { get; }
```

## IsContainer

- Name: `IsContainer`
- Modifiers: `get`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlDatabaseResource.cs#L60)

Gets a value indicating whether the current resource represents a container. If so the actual resource is not running in Azure.

```csharp
public bool IsContainer { get; }
```

## JdbcConnectionString

- Name: `JdbcConnectionString`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlDatabaseResource.cs#L81-L83)

Gets the JDBC connection string for the Azure SQL database.

```csharp
public ReferenceExpression JdbcConnectionString { get; }
```

## Remarks

Format: `jdbc:sqlserver://{host}:{port};database={database};encrypt=true;trustServerCertificate=false`. When running in a container, inherits the container JDBC format including username and password.

## Parent

- Name: `Parent`
- Modifiers: `get`
- Returns: [AzureSqlServerResource](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlDatabaseResource.cs#L31)

Gets the parent Azure SQL Database (server) resource.

```csharp
public AzureSqlServerResource Parent { get; }
```

## UriExpression

- Name: `UriExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlDatabaseResource.cs#L69-L71)

Gets the connection URI expression for the Azure SQL database.

```csharp
public ReferenceExpression UriExpression { get; }
```

## Remarks

Format: `mssql://{host}:{port}/{database}`.
