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

Issue Connecting to Azure SQLServer Public Endpoints #499

Open
jacobreeves opened this issue May 28, 2021 · 5 comments
Open

Issue Connecting to Azure SQLServer Public Endpoints #499

jacobreeves opened this issue May 28, 2021 · 5 comments

Comments

@jacobreeves
Copy link

Operating System

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal

TinyTDS Version and Information

TinyTds 2.1.1

FreeTDS Version

tsql -C

Compile-time settings (established with the "configure" script)
                            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

Description

We are attempting to get TinyTds to connect to an Azure instance via the public endpoint. For public endpoints the host matches the pattern: azure-host.public.some-guid.database.windows.net and the port is 3342.

Using the tsql command below, this works just fine and it connects immediately
tsql -H azure-host.public.some-guid.database.windows.net -U username -p 3342 -P password

However, if we attempt to connect using TinyTds from the same host using the command below
client=TinyTds::Client.new(
:username=> 'username@azure-host',
:password=> 'password',
:host=>'azure-host.public.some-guid.database.windows.net',
:port=>3342,
:encoding=>"UTF-8",
:azure=>true
)

we get the auth error below (pulled from freetds.log)
19:39:55.052288 2790 (token.c:2384):tds_process_info() reading message 18456 from server

So the questions are:

  • All of the documentation we've seen around this references SQLServer on the internal SQLServer port of 1433. Does this library work against the public endpoints on 3342?
  • The user in the sqlserver db is just 'username'. Why is it required to pass 'username@azure-host'?
  • How can we get this to work?

Thanks!

@jacobreeves
Copy link
Author

Hi

Just checking to see if anyone has any ideas on this.

Thanks!

@bvogelzang
Copy link
Contributor

Complete guess but have you tried setting the username as [email protected]?

@jacobreeves
Copy link
Author

Thanks @bvogelzang. Yes. I've tried every permutation I can think of. I've replicated the problem at the FreeTDS level and am going to post a similar issue there.

@aditandrau
Copy link

Hello,

Do you have any updates on this issue?

We are encountering the same issue.

Thanks!

@jacobreeves
Copy link
Author

Hi @aditandrau. Unfortunately, the only update we have is an issue opened against the underlying FreeTDS library here.

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

3 participants