-
Notifications
You must be signed in to change notification settings - Fork 330
MDS Azure Extension Design #3579
-
OverviewFor the MDS 7.0.0 release, we are proposing the following package architecture changes that will decouple several large dependencies from MDS and move them into a new
This will reduce the main MDS package dependency tree along with a moderate package size reduction. ProgressHere are the issues/PRs tracking this work: MotivationIssue: #1108 Customers and the developer community have voiced concerns with MDS being tightly coupled to Azure dependencies. Many customers do not use Azure and do not want to deploy unnecessary DLLs with their applications. Moving the Azure dependent implementations into a separate
The following dependencies will be removed from the main MDS package:
The following dependencies will be removed from the AKV Provider package:
Package ArchitectureclassDiagram
class MDS
class MDS.Extensions.Abstractions
class MDS.Extensions.Azure
class AKV Provider
MDS --> MDS.Extensions.Abstractions
MDS ..> MDS.Extensions.Azure
MDS ..> AKV Provider
MDS.Extensions.Azure --> MDS.Extensions.Abstractions
AKV Provider --> MDS.Extensions.Azure
MDS: Depend on MDS.Extensions.Abstractions
MDS: Load Azure or AKV assembly
MDS.Extensions.Abstractions: Azure Authentication Types
MDS.Extensions.Abstractions: Azure Attestation Types
MDS.Extensions.Abstractions: Azure Key Vault Types
MDS.Extensions.Azure: Depend on MDS.Extensions.Abstractions
MDS.Extensions.Azure: Authentication Implementation
MDS.Extensions.Azure: Attestation Implementation
MDS.Extensions.Azure: Key Vault Implementation
AKV Provider: Depend on MDS.Extensions.Azure
In previous MDS versions, the AKV package depended directly on the main MDS package through a ranged version (for example [6.0.0, 7.0.0) - all 6.x package versions). With the new package architecture this is no longer the case. Extension packages will not depend on the main MDS package, nor will the main MDS package depend on any extension packages. All dependencies between MDS and its extensions will occur through the This new looser coupling gives applications the flexibility to depend on only the main MDS package, or on MDS and a subset of it extension packages if desired. ConsumingThere are several ways that applications may consume MDS and its extensions:
Applications never need to directly depend on the Without Azure FeaturesApplications that do not use any Azure features will no longer bring in those unwanted dependencies transitively. Simply include the main MDS package by itself: <ItemGroup> <PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0" /> </ItemGroup> Calls to MDS APIs that require Azure features will throw an exception, since no Azure feature implementation is present. With MDS Azure FeaturesApplications that wish to use MDS-supplied Azure features will need to include the new <ItemGroup> <PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0" /> <PackageReference Include="Microsoft.Data.SqlClient.Extensions.Azure" Version="1.0.0" /> </ItemGroup> MDS will automatically detect the With External Azure FeaturesApplications that wish to use Azure features supplied by another (non-MDS) package will need to include that package as a direct dependency alongside the main MDS package: <ItemGroup> <PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0" /> <PackageReference Include="My.Azure.Features.Package" Version="1.2.3" /> </ItemGroup> Additionally, applications will need to instruct MDS to use the external Azure feature implementations via the appropriate APIs at runtime:
Versioning StrategyThe MDS suite of packages will be versioned independently. This provides flexibility to update APIs and implementations for packages as needed, avoiding unnecessary version bumps and releases. The initial release of these packages will have the following versions:
Going forward, each package will be versioned appropriately based on the nature of the changes included with subsequent releases. Note: The IntradependenceThe main MDS package and the new For example, imagine that a new extensible conenction pooling feature is added to MDS. The
Both the main MDS package and the new An application wishing to use the new Backwards CompatibilityThere are several backwards compatibility scenarios to consider for applications that rely on MDS Azure features currently implemented in the main MDS package and the AKV package. The new extensions package architecture aims to reduce the friction for these apps, but not all scenarios will be seamless. All of the scenarios below assume that the application is upgrading to the latest versions of MDS packages. Apps using MDS Azure AuthenticationApplications currently using the MDS-supplied Azure Authentication features will need to add a dependency on the <ItemGroup> <PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0" /> <PackageReference Include="Microsoft.Data.SqlClient.Extensions.Azure" Version="1.0.0" /> </ItemGroup> All Azure Authentication namespaces and types will remain the same, so this should be the only change necessary for applications. Apps using MDS Azure AttestationApplications currently using the MDS-supplied Azure Attestation features will need to add a dependency on the <ItemGroup> <PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0" /> <PackageReference Include="Microsoft.Data.SqlClient.Extensions.Azure" Version="1.0.0" /> </ItemGroup> All Azure Attestation namespaces and types will remain the same, so this should be the only change necessary for applications. Apps using AKV ProviderApplications currently using the MDS-supplied AKV provider will have two options when upgrading to MDS v7.0.0. Both options rely on the main MDS package finding and loading an appropriate DLL (assembly) at runtime. The absence of an appropriate DLL will cause Azure Key Vault operations to throw an exception. Use Azure ExtensionThis is the preferred approach. The application would be updated to depend on the main MDS package and the <ItemGroup> <PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0" /> <PackageReference Include="Microsoft.Data.SqlClient.Extensions.Azure" Version="1.0.0" /> </ItemGroup> The Use AKV Provider v7.0.0This is a temporary solution. The AKV provider v7.0.0 will be marked as deprecated and removed entirely at some point in the future. The applictaion would remain dependent on the AKV provider, but must update to the v7.0.0 package. Previous AKV package versions do not support main MDS package versions beyond the v6.x range. <ItemGroup> <PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0" /> <PackageReference Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="7.0.0" /> </ItemGroup> This AKV Provider v7.0.0 package will be empty and simply depend on the |
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 4 -
🎉 2
Replies: 2 comments
-
@paulmedynski This looks great! Just make sure to throw an actionable execption with a docs link when users attempt to use Azure features with just the base package
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Thanks for writing this up. I've not got any changes to suggest in the extension design itself - it looks good to me, and covers everything we'd need.
I'm not sure whether MDS seeking and loading the Azure library would work in AOT and single-file application scenarios, so those will likely need to be tested and potentially documented as we add support for each scenario. Perhaps we could add a warning somewhere if someone is relying on the behaviour?
After the design has been confirmed and the API surface is being looked at, it might also be a good idea to revisit the API surface for SqlAuthenticationProvider and SqlColumnEncryptionKeyStore. At the moment, SqlAuthenticationProvider only has an async method (which doesn't accept a CancellationToken) and SqlColumnEncryptionKeyStore only has sync methods. This guarantees sync-over-async or async-over-sync in some scenarios. If we ensure that all three API surfaces have both an async method (which accepts a CancellationToken) and a sync method, then we can start to use those methods in the future and it might start to unblock some issues @mdaigle noticed when working on #3404.
Beta Was this translation helpful? Give feedback.