Add support for Azure AD device code authentication
Currently --authentication-method supports ActiveDirectoryInteractive which uses azidentity.InteractiveBrowserCredential. This limits usage to windowed environments with a web browser.
Consider supporting a new authentication method ActiveDirectoryDeviceCode which would use azidentity.DeviceCodeCredential.
thx for opening an issue! We need to add this method to the driver first.
Now that i think about it, even better would be support for AzureCliCredential, which would allow using an ambient Azure CLI authenticated context (which supports device code authentication) in an SSO manner. Support for this would mean no need to authenticate sqlcmd at all if Azure CLI was already authenticated, which it often is. Should this be a separate request?
--authentication-method ActiveDirectoryDefault includes AzureCliCredential in the search
@shueybubbles great! I didn’t notice that since i assumed ActiveDirectoryDefault was a combination of the other methods directly supported by go-sqlcmd rather than those supported by azidentity.
Are you going to solve this?
we added azcli and device code here https://github.com/microsoft/go-sqlcmd/commit/0a4cd1949a9ff220649a4f7bd0d9f775488df8e1#diff-8b63f3c9b8211c5793c8ac1aa5113aae3858130effb2401bcb8364e8664ce62d