rdagumampan / yuniql

Free and open source schema versioning and database migration made natively with .NET/6. NEW THIS MAY 2022! v1.3.15 released!
https://yuniql.io
Apache License 2.0
417 stars 63 forks source link

Active domain authentication for SQL server tested and appears to be working. #281

Open jan-hudec opened 2 years ago

jan-hudec commented 2 years ago

I tested the Authentication=Active Directory Default authentication method as per https://docs.microsoft.com/en-us/sql/connect/ado-net/sql/azure-active-directory-authentication?view=azuresqldb-current and it logged in automatically by calling out to azure cli as expected.

Since all the Authentication methods in that list are configured with connection string and environment only, I am somewhat confident they will all work given the correct circumstances.

The only limitation then really is obtaining the authentication token externally (e.g. with az account get-access-token --resource=https://database.windows.net or the corresponding call of the identity library), because that cannot be passed via connection string but must be assigned to the SqlConnection.AccessToken separately.

rdagumampan commented 2 years ago

@jan-hudec Thanks for reaching out and your interest in yuniql. I hope you are able to use yuniql perhaps in a different way. This is a feature I know need some changes and it helps lot that you describe how we can pass the token. I don't have an AAD to test against to so I hope someone can make PR to make this changes.

This can be as simple as adding -sqlserver-access-token <your-token> to the yuniql cli.