You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Huge build size regression due to added broker support #4410
We're using Microsoft.Data.SqlClient in a cloud service running on Linux x64 in containers. With the upgrade to the newly released version 6.1.6 (also happens with 7.0.2), our container size increased a lot.
#4288 added broker support for interactive Entra ID auth. To implement this, the Microsoft.Data.SqlClient.Extensions.Azure package gained a dependency on Microsoft.Identity.Client.Broker.
This is the crux: In a cloud service, we don't have interactive auth anyway, and the PR even explicitly states
Non-Windows: broker is never used.
Thus, it should be possible to have a build without all the binaries needed for broker support as that is all dead code in our case, but the build doesn't know and puts all the binaries there all the time.
To reproduce
Create a new .NET 10 console application project and add references to Microsoft.Data.SqlClient 7.0.1 and Microsoft.Data.SqlClient.Extensions.Azure 1.0.0. Compile the project and check the output directory size.
Then, upgrade the Microsoft.Data.SqlClient* dependencies to 7.0.2, rebuild the project, and check the output directory size again.
On my system (Release configuration):
Version
Size in bytes
7.0.1 + 1.0.0
15,607,664
7.0.2
78,921,330
To be fair, in a production build one would use dotnet publish --runtime linux-x64 which brings down the output to 48,494,987 bytes, but that's still a whopping 32 MiB more than with the previous version.
Expected behavior
I'm able to choose whether I want to have broker support or not by being able to install a dedicated package that adds broker support if needed.
All required environment details provided for investigation
Area
Area\Azure Connectivity
Duplicates
None found
Regression
Likely regression from v7.0.1 → v7.0.2 (introduced by #4288)
Analysis
PR #4288 added Windows Account Manager (WAM) broker support to Microsoft.Data.SqlClient.Extensions.Azure by adding a hard dependency on Microsoft.Identity.Client.Broker, which pulls in ~30–63 MB of additional native binaries. Since the PR itself states that broker support is never used on non-Windows platforms, this dependency is dead weight for Linux/macOS cloud services — causing a ~5× binary size increase (15.6 MB → 78.9 MB uncompressed, or +32 MiB with --runtime linux-x64 publish). The feature itself works correctly; the issue is that the broker dependency is unconditional rather than opt-in, which affects container size and deployment costs for all non-interactive service workloads. Severity: P2 — significant impact on cloud/container deployment scenarios.
Next Steps
Assign to Copilot coding agent to investigate splitting broker support into a separate opt-in package (e.g., Microsoft.Data.SqlClient.Extensions.Azure.Broker) or using RID-specific/platform-conditional <PackageReference> in the .csproj/.nuspec to make Microsoft.Identity.Client.Broker a Windows-only dependency that does not flow to Linux/macOS publish outputs.
Specifically investigate whether <PackageReference Include="Microsoft.Identity.Client.Broker" Condition="'$(RuntimeIdentifier)' == 'win-x64' ..." /> or <group targetFramework="... /runtime-windows/" /> in the nuspec can gate the transitive dependency, and validate that the existing WAM broker code paths still compile with a guard.
Note: This triage summary is auto-generated by an AI agent. The analysis and suggestions above have not been verified by a human maintainer. Please treat as preliminary guidance only.
To add to this - is it definitely correct to say that the broker only works on Windows? This article seems to indicate that as long as the OS runs the microsoft-identity-broker package, MSAL is capable of supporting the broker.
If so, the triage bot's proposal of a RID-specific dependency wouldn't actually address the size issue - it'd just mask it away from Linux until someone asks for the library to enable OS-independent broker support.
We have the same issue with the upgrade from 6.1.5 to 6.1.6.
One of our repos, hosting over a hundred dotnet projects and producing about 20 Docker images, can no longer be built on Microsoft hosted agents while referencing the new version. The total disk space usage for the build (dotnet publish and Docker compose) has ballooned by about 8 gigabytes.
Thanks for reporting the situation. We are aware that the new dependency increases the package size and it's certainly not ideal. Unfortunately, our options are limited due to the fact that the default Entra ID application in the Microsoft.Data.SqlClient.Extensions.Azure package is a Microsoft first party app. Microsoft requires specific configuration for first party apps to maintain a strong security posture. It would be untenable for us to publish a separate package per auth-related library to isolate any potential changes. We try to maintain default implementations that work for most use cases and provide extension points for customers should the defaults not meet their needs.
Now that most auth dependencies are split out into the Microsoft.Data.SqlClient.Extensions.Azure package, you have the flexibility to skip all of our default auth implementations and dependencies and use your own token acquisition logic. Of the two options, I typically recommend using the AccessTokenCallback because it's a lighter weight API.
Implementing one of these will let you skip the Microsoft.Data.SqlClient.Extensions.Azure dependency (and the new broker dependency) entirely. You will be in control of the MSAL version and configurations you use.
Hopefully this gives some ideas for paths forward, but please reach out if you have any questions.
Activity
github-actions commentedon Jun 26, 2026
🔍 Triage Summary
Area\Azure ConnectivityAnalysis
PR #4288 added Windows Account Manager (WAM) broker support to
Microsoft.Data.SqlClient.Extensions.Azureby adding a hard dependency onMicrosoft.Identity.Client.Broker, which pulls in ~30–63 MB of additional native binaries. Since the PR itself states that broker support is never used on non-Windows platforms, this dependency is dead weight for Linux/macOS cloud services — causing a ~5× binary size increase (15.6 MB → 78.9 MB uncompressed, or +32 MiB with--runtime linux-x64publish). The feature itself works correctly; the issue is that the broker dependency is unconditional rather than opt-in, which affects container size and deployment costs for all non-interactive service workloads. Severity: P2 — significant impact on cloud/container deployment scenarios.Next Steps
Microsoft.Data.SqlClient.Extensions.Azure.Broker) or using RID-specific/platform-conditional<PackageReference>in the.csproj/.nuspecto makeMicrosoft.Identity.Client.Brokera Windows-only dependency that does not flow to Linux/macOS publish outputs.<PackageReference Include="Microsoft.Identity.Client.Broker" Condition="'$(RuntimeIdentifier)' == 'win-x64' ..." />or<group targetFramework="... /runtime-windows/" />in the nuspec can gate the transitive dependency, and validate that the existing WAM broker code paths still compile with a guard.edwardneal commentedon Jun 28, 2026
To add to this - is it definitely correct to say that the broker only works on Windows? This article seems to indicate that as long as the OS runs the
microsoft-identity-brokerpackage, MSAL is capable of supporting the broker.If so, the triage bot's proposal of a RID-specific dependency wouldn't actually address the size issue - it'd just mask it away from Linux until someone asks for the library to enable OS-independent broker support.
jopa-vrb commentedon Jun 29, 2026
We have the same issue with the upgrade from 6.1.5 to 6.1.6.
One of our repos, hosting over a hundred dotnet projects and producing about 20 Docker images, can no longer be built on Microsoft hosted agents while referencing the new version. The total disk space usage for the build (dotnet publish and Docker compose) has ballooned by about 8 gigabytes.
mdaigle commentedon Jun 30, 2026
Thanks for reporting the situation. We are aware that the new dependency increases the package size and it's certainly not ideal. Unfortunately, our options are limited due to the fact that the default Entra ID application in the Microsoft.Data.SqlClient.Extensions.Azure package is a Microsoft first party app. Microsoft requires specific configuration for first party apps to maintain a strong security posture. It would be untenable for us to publish a separate package per auth-related library to isolate any potential changes. We try to maintain default implementations that work for most use cases and provide extension points for customers should the defaults not meet their needs.
Now that most auth dependencies are split out into the Microsoft.Data.SqlClient.Extensions.Azure package, you have the flexibility to skip all of our default auth implementations and dependencies and use your own token acquisition logic. Of the two options, I typically recommend using the AccessTokenCallback because it's a lighter weight API.
Implementing one of these will let you skip the Microsoft.Data.SqlClient.Extensions.Azure dependency (and the new broker dependency) entirely. You will be in control of the MSAL version and configurations you use.
Hopefully this gives some ideas for paths forward, but please reach out if you have any questions.