Synetec.Data.SqlClient.ManagedIdentity
1.0.0
dotnet add package Synetec.Data.SqlClient.ManagedIdentity --version 1.0.0
NuGet\Install-Package Synetec.Data.SqlClient.ManagedIdentity -Version 1.0.0
<PackageReference Include="Synetec.Data.SqlClient.ManagedIdentity" Version="1.0.0" />
<PackageVersion Include="Synetec.Data.SqlClient.ManagedIdentity" Version="1.0.0" />
<PackageReference Include="Synetec.Data.SqlClient.ManagedIdentity" />
paket add Synetec.Data.SqlClient.ManagedIdentity --version 1.0.0
#r "nuget: Synetec.Data.SqlClient.ManagedIdentity, 1.0.0"
#:package Synetec.Data.SqlClient.ManagedIdentity@1.0.0
#addin nuget:?package=Synetec.Data.SqlClient.ManagedIdentity&version=1.0.0
#tool nuget:?package=Synetec.Data.SqlClient.ManagedIdentity&version=1.0.0
Synetec.Data.SqlClient.ManagedIdentity
Host-side SqlAuthenticationProvider for Azure SQL "Active Directory Managed Identity"
authentication, for use with Microsoft.Data.SqlClient 7.0+.
Why this exists
Microsoft.Data.SqlClient 7.0 removed built-in support for the ActiveDirectoryManagedIdentity
connection-string authentication method from the core package. It's now resolved via reflection
into Microsoft.Data.SqlClient.Extensions.Azure, whose dependency chain
(Microsoft.Identity.Client.Broker → Microsoft.Identity.Client.NativeInterop) wraps the
Windows WAM broker and has no Linux support. The first connection that needs AD auth triggers
SqlAuthenticationProviderManager's static constructor, which throws TypeInitializationException
on Linux — and because that registry is a process-wide static, the crash poisons every DbContext
in the process for its remaining lifetime.
This package registers a lightweight provider that wraps Azure.Identity's
ManagedIdentityCredential directly, with no Broker/MSAL dependency involved.
Usage
If your connection string uses Authentication=Active Directory Managed Identity (or another
Azure AD auth method resolved by this provider) with Microsoft.Data.SqlClient 7.0+, call
SqlAuthenticationProviderRegistration.RegisterManagedIdentity() as the first statement in your
Program.cs, before builder.Build() or any DbContext/SqlConnection use:
using Synetec.Data.SqlClient.ManagedIdentity;
SqlAuthenticationProviderRegistration.RegisterManagedIdentity();
var builder = WebApplication.CreateBuilder(args);
// ...
This is a process-wide registration, so it automatically covers any DbContext from
Synetec.UserManager, Synetec.FeatureManagement, or elsewhere in the same process — no
additional code is needed in those libraries or in your own DbContexts.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Identity (>= 1.21.0)
- Microsoft.Data.SqlClient.Extensions.Abstractions (>= 7.1.0)
-
net8.0
- Azure.Identity (>= 1.21.0)
- Microsoft.Data.SqlClient.Extensions.Abstractions (>= 7.1.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Synetec.Data.SqlClient.ManagedIdentity:
| Package | Downloads |
|---|---|
|
Synetec.UserManager
This library enables user management within an application using Microsoft B2C Authentication. It supports key workflows such as: Inviting a user to the application; Validating a user token, returning the B2C workflow to use; Roles for the user, including an authorization filter. |
|
|
Synetec.FeatureManagement
This is a wrapper for the Microsoft.FeatureManagement library that adds additional functionality and provides an endpoint for a frontend application to retrieve feature flags. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 42 | 9/23/2026 |
Initial release.