# AspireSqlServerSqlClientExtensions

- Kind: `class`
- Package: [Aspire.Microsoft.Data.SqlClient](/reference/api/csharp/aspire.microsoft.data.sqlclient.md)
- Version: `13.4.0`
- Namespace: `Microsoft.Extensions.Hosting`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Components/Aspire.Microsoft.Data.SqlClient/AspireSqlServerSqlClientExtensions.cs)

Extension methods for configuring SqlClient connection to Azure SQL, MS SQL server

## Definition

```csharp
namespace Microsoft.Extensions.Hosting;

public static class AspireSqlServerSqlClientExtensions
{
    // ...
}
```

## Methods

- [AddKeyedSqlServerClient(IHostApplicationBuilder, string, Action<MicrosoftDataSqlClientSettings>)](/reference/api/csharp/aspire.microsoft.data.sqlclient/aspiresqlserversqlclientextensions/methods.md#addkeyedsqlserverclient-ihostapplicationbuilder-string-action-microsoftdatasqlclientsettings) `extension` -- Registers 'Scoped' `SqlClient.SqlConnection` factory for given `name` for connecting Azure SQL, MsSQL database using Microsoft.Data.SqlClient. Configures health check, logging and telemetry for the SqlClient.
- [AddSqlServerClient(IHostApplicationBuilder, string, Action<MicrosoftDataSqlClientSettings>)](/reference/api/csharp/aspire.microsoft.data.sqlclient/aspiresqlserversqlclientextensions/methods.md#addsqlserverclient-ihostapplicationbuilder-string-action-microsoftdatasqlclientsettings) `extension` -- Registers 'Scoped' `SqlClient.SqlConnection` factory for connecting Azure SQL, MS SQL database using Microsoft.Data.SqlClient. Configures health check, logging and telemetry for the SqlClient.
