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

Guidance on how to do password-less login using Azure Service Principal or Managed Identity #1011

Open
sivawba opened this issue Mar 6, 2022 · 2 comments
Labels

Comments

@sivawba
Copy link

sivawba commented Mar 6, 2022

Issue

We are trying to port a Rails application to Azure cloud and would like to use Azure Service Principal or Managed Identity instead of the database.yml username/password, while connecting to Azure SQL-MI

Is it possible to do this without specifying username/password in database.yml by using access_token from Azure IMDS endpoint as shown here for Python?

Any pointers on how to accomplish this would be greatly helpful. Thanks again for a great library that is helping us move forward with the port.

Expected behavior

Login to Azure SQLServer MI without providing username/password in database.yml

Actual behavior

Not sure how to proceed or whether this can be done

Details

  • Rails version: 5.2.3

  • SQL Server adapter version: 5.2.0

  • TinyTDS version: 2.1.5

  • FreeTDS details: 1.1.24

       MS db-lib source compatibility: no
          Sybase binary compatibility: no
                        Thread safety: yes
                        iconv library: yes
                          TDS version: 7.3
                                iODBC: no
                             unixodbc: no
                SSPI "trusted" logins: no
                             Kerberos: no
                              OpenSSL: yes
                               GnuTLS: no
                                 MARS: yes
    
@Michoels
Copy link

This isn't supported by FreeTDS yet.
I opened an issue for it here

@Michoels
Copy link

Michoels commented Sep 11, 2024

Update:
The azure-blob gem just added support for Entra ID (Managed Identity) in release 0.5.0.
So obtaining a valid auth token from Entra ID in Ruby is now a solved problem.

We can't take advantage of that yet, as FreeTDS still does not support Entra ID.

See TinyTDS issue 512

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

No branches or pull requests

3 participants