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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Synetec.Data.SqlClient.ManagedIdentity" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Synetec.Data.SqlClient.ManagedIdentity" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Synetec.Data.SqlClient.ManagedIdentity" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Synetec.Data.SqlClient.ManagedIdentity --version 1.0.0
                    
#r "nuget: Synetec.Data.SqlClient.ManagedIdentity, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Synetec.Data.SqlClient.ManagedIdentity@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Synetec.Data.SqlClient.ManagedIdentity&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Synetec.Data.SqlClient.ManagedIdentity&version=1.0.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.