Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does Microsoft.Data.SqlClient support web.config-based SqlAuthenticationProviders when installed in a .NET Framework app? #663

Closed
madelson opened this issue Jul 22, 2020 · 6 comments
Labels
⏳ Waiting for Customer We're waiting for your response :)

Comments

@madelson
Copy link
Contributor

We're trying to migrate applications to .NET Core and along the way we're looking to switch over to Microsoft.Data.SqlClient.

Some of our apps use this method to set up azure access tokens: https://azure.microsoft.com/en-us/blog/securing-azure-sql-databases-with-managed-identities-just-got-easier/

From looking at the MDSC code, it seems like this will continue to work in a .NET Core app: (https://github.com/dotnet/SqlClient/blob/master/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetCoreApp.cs) but may not work if MDSC is installed in a .NET Framework app (https://github.com/dotnet/SqlClient/blob/master/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetStandard.cs).

Am I interpreting this correctly? If so, would you recommend that NuGet packages aiming to support both .NET Framework and .NET Core apps use multi-targeting to switch between MDSC and System.Data.SqlClient?

@cheenamalhotra
Copy link
Member

cheenamalhotra commented Jul 22, 2020

Hi @madelson

For .NET Framework, the correct class is here:
https://github.com/dotnet/SqlClient/blob/master/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs

It would work as expected if you target .NET Framework and not via .NET Standard library.

However, we are also going to introduce "Azure Managed Identity" authentication support in Microsoft.Data.SqlClient (#616) and it's planned for next release cycle (v2.1.0).

@cheenamalhotra cheenamalhotra added this to Needs triage in SqlClient Triage Board via automation Jul 24, 2020
@cheenamalhotra cheenamalhotra moved this from Needs triage to Waiting for customer in SqlClient Triage Board Jul 24, 2020
@cheenamalhotra
Copy link
Member

@madelson

Waiting for your reply, I hope your query is resolved?

@JRahnama JRahnama added the ⏳ Waiting for Customer We're waiting for your response :) label Jul 30, 2020
@cheenamalhotra
Copy link
Member

Closed as inactive.

SqlClient Triage Board automation moved this from Waiting for customer to Closed Aug 19, 2020
@madelson
Copy link
Contributor Author

@cheenamalhotra when you say:

However, we are also going to introduce "Azure Managed Identity" authentication support in Microsoft.Data.SqlClient (#616) and it's planned for next release cycle (v2.1.0).

What will this look like for apps that today use the web.config based approach that want to switch over to .NET core?

@cheenamalhotra
Copy link
Member

cheenamalhotra commented Aug 28, 2020

For apps that currently provide web.config as of now in .NET Core, will no longer need to do that.

With #616 being addressed, it will be implemented in the driver and no custom configuration would be needed.
Managed Identity based authentication will work directly with a new Connection String "Authentication" property value.

@madelson
Copy link
Contributor Author

Sounds great. Thanks for the additional details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⏳ Waiting for Customer We're waiting for your response :)
Projects
Development

No branches or pull requests

3 participants