# AzureSqlServerResource

- Kind: `class`
- Package: [Aspire.Hosting.Azure.Sql](/reference/api/csharp/aspire.hosting.azure.sql.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs)
- Inherits: `AzureProvisioningResource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IValueProvider`, `IValueWithReferences`, `IAzureNspAssociationTarget`, `IAzurePrivateEndpointTarget`, `IAzurePrivateEndpointTargetNotification`

Represents an Azure Sql Server resource.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzureSqlServerResource
    : Aspire.Hosting.Azure.AzureProvisioningResource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences,
      Aspire.Hosting.Azure.IAzureNspAssociationTarget,
      Aspire.Hosting.Azure.IAzurePrivateEndpointTarget,
      Aspire.Hosting.Azure.IAzurePrivateEndpointTargetNotification
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Azure.Sql/AzureSqlServerResource`

## Constructors

- [AzureSqlServerResource(string, Action<AzureResourceInfrastructure>)](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/constructors.md#constructor-string-action-azureresourceinfrastructure) -- Initializes a new instance of the [AzureSqlServerResource](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource.md) class.
- [AzureSqlServerResource(SqlServerServerResource, Action<AzureResourceInfrastructure>)](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/constructors.md#constructor-sqlserverserverresource-action-azureresourceinfrastructure) `obsolete` -- Initializes a new instance of the [AzureSqlServerResource](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource.md) class.

## Properties

- [Annotations](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#annotations) : `ResourceAnnotationCollection` `get` `ats ignored`
- [AzureSqlDatabases](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#azuresqldatabases) : `IReadOnlyDictionary<string, AzureSqlDatabaseResource>` `get` -- A dictionary where the key is the resource name and the value is the Azure SQL database resource.
- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection template for the manifest for the Azure SQL Server resource.
- [Databases](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#databases) : `IReadOnlyDictionary<string, string>` `get` -- A dictionary where the key is the resource name and the value is the Azure SQL database name.
- [FullyQualifiedDomainName](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#fullyqualifieddomainname) : `BicepOutputReference` `get` -- Gets the fully qualified domain name (FQDN) output reference from the bicep template for the Azure SQL Server resource.
- [HostName](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#hostname) : `ReferenceExpression` `get` -- Gets the host name for the SQL Server.
- [Id](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#id) : `BicepOutputReference` `get` -- Gets the "id" output reference for the resource.
- [IsContainer](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#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](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#jdbcconnectionstring) : `ReferenceExpression` `get` -- Gets the JDBC connection string for the server.
- [NameOutputReference](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#nameoutputreference) : `BicepOutputReference` `get` -- Gets the "name" output reference for the resource.
- [Port](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#port) : `ReferenceExpression` `get` -- Gets the port for the PostgreSQL server.
- [UriExpression](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/properties.md#uriexpression) : `ReferenceExpression` `get` -- Gets the connection URI expression for the SQL Server.

## Methods

- [AddAsExistingResource(AzureResourceInfrastructure)](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/methods.md#addasexistingresource-azureresourceinfrastructure) : `ProvisionableResource`
- [AddRoleAssignments(IAddRoleAssignmentsContext)](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource/methods.md#addroleassignments-iaddroleassignmentscontext)
