Azure-docs: The type or namespace name 'SqlAuthenticationProvider' does not exist in the namespace 'System.Data.SqlClient'

Created on 7 Feb 2020  Â·  13Comments  Â·  Source: MicrosoftDocs/azure-docs

SqlAuthenticationProvider no longer seems to be apart of System.Dat.SqlClient? I attempted to use every version from 4.4.3 to 4.8.0.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author doc-bug securitsubsvc sql-databassvc triaged

All 13 comments

SMH. Update the document. You need 'Microsoft.Data.SqlClient'.

@theGrower We are checking this and we will get back to you.

@theGrower Yes Microsoft.Data.SQLClient is the way forward and System.Data.SqlClient is in maintenance. Here is the document for the same.
https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/

@GithubMirek Please convey if we can go ahead and swap/edit these namespaces for this document.

Thanks for the update. There are still two more problems. Line 121 new AD.PlatformParameters(AD.PromptBehavior.Auto),, the constructor for PlatformParameters takes in two arguements ( PromptBehavior promptBehavior, ICustomWebUi customWebUi ) which is not accounted for.

Line 142 new AD.UserPasswordCredential( there is no longer a UserPasswordCredential method. Looks like another replacement? I see an experimental version of this nuget package, I also see Azure.ActiveDirectory, Microsoft.WindowsAzure.ActiveDiretory.Athentication ...

I just need to write a console app to do some traversing of data that is in a network tree structure to identify a problem. It would be way overkill to do this in our API. I just need to be able to connect to our Azure DB.

@GithubMirek Please check if the whole document can be checked and corrected/enhanced.
@theGrower We are assigning this to our doc author for further review.

What about this issue?
I also tried to use the example here and got the same errors...
Trying to authenticate to Azure SQL server with a user that has 2FA enabled in AAD from a .net core 2.2 console app/app service, don't understand from this document if this is even supported.

Also seeing those 2 errors. Looking for solutions or clarification.

Thanks

Hello @theGrower! Thanks for submitting this issue. I'm checking with our Product Group on the sample app.

Hello @theGrower! I checked with our Product Group, and unfortunately, we don't have the cycles to provide a new sample application at the moment. We will plan to have this article updated in the future, but there are currently no ETA I can provide. If the document gets updated, I will provide an update on this thread.

Please feel free to let us know if you have any concerns. I will close this thread for now, as I am tracking this internally.

please-close

Why close this thread?
People are looking for a solution to this issue and if they see it's
already open and waiting for an update they won't need to write to you
again.
Just tell us if it's possible to authenticate to an Azure SQL database with
a user that has MFA enabled from .net core.

On Wed, Mar 18, 2020, 22:08 Van To notifications@github.com wrote:

Hello @theGrower https://github.com/theGrower! I checked with our
Product Group, and unfortunately, we don't have the cycles to provide a new
sample application at the moment. We will plan to have this article updated
in the future, but there are currently no ETA I can provide. If the
document gets updated, I will provide an update on this thread.

Please feel free to let us know if you have any concerns. I will close
this thread for now, as I am tracking this internally.

please-close

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/MicrosoftDocs/azure-docs/issues/47676#issuecomment-600834310,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMQGWUUQIEZVQ44PUIULQMTRIES5NANCNFSM4KRQNT3A
.

Hi @vladik-hbinov! We appreciate the feedback. As I'm tracking this internally, there's no need to keep this GitHub Issue open. If customer's need immediate assistance, I recommend contacting Microsoft Support. This forum is for documentation changes, and unfortunately, we cannot assist with a new sample at the moment. This forum is not meant to track support issues. Here are the different ways you can get assistance:

@vladik-hbinov - To answer your last question:

It’s possible. But it’s not built in to SqlClient on .NET Core. (It is built into Microsoft.Data.SqlClient on .NET Framework.) In order to do MFA authentication when it’s not built in, the application needs to obtain the access token itself using Azure authentication libraries and pass it into the SqlConnection.AccessToken property before opening the connection.

Found an option doing what I was looking for on .net core after creating this thread https://social.msdn.microsoft.com/Forums/en-US/4334293a-1f67-4a5f-81ce-2082fbac3bc5/azure-active-directory-with-mfa-azure-sql-database-connection-string and getting an answer from Mike Ubezzi who pointed me to the right direction also and this document https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi#modify-aspnet-core
Adding
var token = TokenProvider.GetAccessTokenAsync("https://database.windows.net/").Result;
SqlConnection conn = (SqlConnection)Database.GetDbConnection();
conn.AccessToken = token;
Did the trick after I did what his answer says and added my Azure account to Visual Studio.
Hope it will help someone in the future.

Was this page helpful?
0 / 5 - 0 ratings