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

Support for Azure SQL MI authentication using token credential #794

Open
sasathy1 opened this issue Jan 5, 2024 · 0 comments
Open

Support for Azure SQL MI authentication using token credential #794

sasathy1 opened this issue Jan 5, 2024 · 0 comments

Comments

@sasathy1
Copy link

sasathy1 commented Jan 5, 2024

Is your feature request related to a problem? Please describe.
The mssqldb SDK supports Azure SQL authentication through few different ways:

  1. username/password
  2. service principal
  3. managed identity (through access token)

Would it be possible to support managed identity through token credential as well (ie. something akin to azidentity.ManagedIdentityCredential)?

Reason for the ask
Our system works on the edge in most scenarios, but we need to use MI auth to communicate with Azure SQL in the cloud. We are relying heavily on azure-sdk-for-go since the SDK takes care of doing the heavylifting for us (ie. defining the right scope and calling the appropriate MSI endpoint in the edge). Since we are abstracted from the nitty gritties of fetching the token, it would be easier for us if SQL could support MI Auth through token credential instead of just access token.

Describe the solution you'd like
I am expecting to do something like below to perform MI auth with Azure SQL:

connString := fmt.Sprintf("Server=foo;Database=bar")
cred, _ := azidentity.NewManagedIdentityCredential(nil)
connector, err := mssql.WithTokenCredential(connString,cred)
conn := mssql.OpenDB(connector)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant