Skip to content

Support passwordless authentication to Azure hosted MsSQL #2059

Description

@jfgreen-liberis

Feature description

Allow MsSQL destination to support passwordless authentication via a token.

This token is typically obtained using azure.identity.DefaultAzureCredential() but it can also be obtained via other methods like OIDC.

Are you a dlt user?

Yes, I'm already a dlt user.

Use case

I'm looking to get DLT setup reading/writing to MsSQL running in Azure and am hoping to use a passwordless connection.

Proposed solution

Looking at the current implementation, this might be as simple as modifying MsSqlCredentials to accept either a username/password or a token. If present, this token would then be included in pyodbc.connect via the attrs_before argument. If this sounds like an OK approach I am happy to draft a PR.

I experimented with doing a slightly underhanded runtime patch of pyodbc.connect with the added token and this seemed to work OK with DLT loading a table quite happily.

Related issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    credentialsIssue with configuration and authentication

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Planned

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions