# AzureSqlServerResource Constructors

- 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: `Constructors`
- Members: `2`

Represents an Azure Sql Server resource.

## AzureSqlServerResource(string, Action<AzureResourceInfrastructure>)

- Name: `Constructor(string, Action<AzureResourceInfrastructure>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs#L34-L86)

Initializes a new instance of the [AzureSqlServerResource](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource.md) class.

```csharp
public class AzureSqlServerResource
{
    public AzureSqlServerResource(
        string name,
        Action<AzureResourceInfrastructure> configureInfrastructure)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `configureInfrastructure` (`Action<AzureResourceInfrastructure>`)
  Callback to configure the Azure resources.

## AzureSqlServerResource(SqlServerServerResource, Action<AzureResourceInfrastructure>)

> **Obsolete:** This method is obsolete and will be removed in a future version. Use AddAzureSqlServer instead to add an Azure SQL server resource.

- Name: `Constructor(SqlServerServerResource, Action<AzureResourceInfrastructure>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs#L34-L86)

Initializes a new instance of the [AzureSqlServerResource](/reference/api/csharp/aspire.hosting.azure.sql/azuresqlserverresource.md) class.

```csharp
public class AzureSqlServerResource
{
    public AzureSqlServerResource(
        SqlServerServerResource innerResource,
        Action<AzureResourceInfrastructure> configureInfrastructure)
    {
        // ...
    }
}
```

## Parameters

- `innerResource` (`SqlServerServerResource`)
  The `ApplicationModel.SqlServerServerResource` that this resource wraps.
- `configureInfrastructure` (`Action<AzureResourceInfrastructure>`)
  Callback to configure the Azure resources.
