Open jan-hudec opened 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
.
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 theSqlConnection.AccessToken
separately.