Using tiny_tds gem unable to connect to Azure Managed instance sql server

345 views Asked by At

I'm in a linux container using the gem file tiny_tds (verions 2.1.1) to try to connect to sql server on an Azure Managed instance.

The code I'm using to connect is this:

client=TinyTds::Client.new(:username=>'[email protected]', :password=> 'password', :host=>'full.server.name.database.windows.net', :port=>3342, :database=>'database',  :azure=>true)

I've tried running this both from the ruby console, as well as from within the container.

Here is the info for the freetds that I'm using:

                        Version: freetds v1.00.91
         freetds.conf directory: /usr/local/etc
 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: no

I'm consistently getting the error message: Login failed for user '[email protected]

Curiously, I'm able to connect via freetds:

tsql -H full.server.name.database.windows.net -U username -D database -p 3342 -P password

I'm wondering if it has something to do with the server/host having multiple '.' characters in the host name.

Also, from what I've read about tiny_tds, when connecting to Azure, the username needs to have the @servername appended to it.

I have tried several version of tiny_tds (all to no effect).

I have also tried many various permutations of the connection string. Nada.

Please let me know if you have any suggestions!!

0

There are 0 answers