Description
Is your feature request related to a problem? Please describe.
The mssqldb SDK supports Azure SQL authentication through few different ways:
- username/password
- service principal
- 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)
Activity