# AzureSqlServerResource Properties

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

Represents an Azure Sql Server resource.

## Annotations

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

```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.

## AzureSqlDatabases

- Name: `AzureSqlDatabases`
- Modifiers: `get`
- Returns: `IReadOnlyDictionary<string, AzureSqlDatabaseResource>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs#L165)

A dictionary where the key is the resource name and the value is the Azure SQL database resource.

```csharp
public IReadOnlyDictionary<string, AzureSqlDatabaseResource> AzureSqlDatabases { get; }
```

## ConnectionStringExpression

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

Gets the connection template for the manifest for the Azure SQL Server resource.

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

## Databases

- Name: `Databases`
- Modifiers: `get`
- Returns: `IReadOnlyDictionary<string, string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs#L170-L173)

A dictionary where the key is the resource name and the value is the Azure SQL database name.

```csharp
public IReadOnlyDictionary<string, string> Databases { get; }
```

## FullyQualifiedDomainName

- Name: `FullyQualifiedDomainName`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs#L61)

Gets the fully qualified domain name (FQDN) output reference from the bicep template for the Azure SQL Server resource.

```csharp
public BicepOutputReference FullyQualifiedDomainName { get; }
```

## HostName

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

Gets the host name for the SQL Server.

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

## Remarks

In container mode, resolves to the container's primary endpoint host. In Azure mode, resolves to the Azure SQL Server's fully qualified domain name.

## Id

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

Gets the "id" output reference for the resource.

```csharp
public BicepOutputReference Id { get; }
```

## IsContainer

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

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/AzureSqlServerResource.cs#L411-L413)

Gets the JDBC connection string for the server.

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

## Remarks

Format: `jdbc:sqlserver://{host}:{port};authentication=ActiveDirectoryIntegrated;encrypt=true;trustServerCertificate=true`.

## NameOutputReference

- Name: `NameOutputReference`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs#L66)

Gets the "name" output reference for the resource.

```csharp
public BicepOutputReference NameOutputReference { get; }
```

## Port

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

Gets the port for the PostgreSQL server.

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

## Remarks

In container mode, resolves to the container's primary endpoint port. In Azure mode, resolves to 1433.

## UriExpression

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

Gets the connection URI expression for the SQL Server.

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

## Remarks

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