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

can not log into sql server using domain account #430

Open
yxl1108 opened this issue Jul 31, 2023 · 4 comments
Open

can not log into sql server using domain account #430

yxl1108 opened this issue Jul 31, 2023 · 4 comments

Comments

@yxl1108
Copy link

yxl1108 commented Jul 31, 2023

OS: WSL2 / Ubuntu 20.04.6 LTS (Focal Fossa)
Driver: Microsoft ODBC Driver 18 for SQL Server

Installation:
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list
apt-get update
ACCEPT_EULA=Y apt-get install -y msodbcsql18
apt-get install -y unixodbc-dev gnupg libkrb5-dev pkg-config

dbt profile.yml:
local:
type: sqlserver
driver: 'ODBC Driver 18 for SQL Server'
server: sql-server-instance.domain.com
port: 1433
trust_cert: true
database: database_name
schema: dbo
authentication: ActiveDirectoryPassword
user: 'DOMAIN\username'
password: 'password'
threads: 4

Error:
with authentication: ActiveDirectoryPassword

Database Error
('28000', "[28000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Login failed for user ''. (18456) (SQLDriverConnect)")

without authentication: ActiveDirectoryPassword

Database Error
('28000', "[28000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Login failed for user 'DOMAIN\\username'. (18456) (SQLDriverConnect)")

Observations:
sql server authentication works fine

@NicolasPA
Copy link

If it can help, this is what we're using to connect with the Windows user of the current session.

dbt-transform:
  target: local
  outputs:
    local:
      type: sqlserver
      driver: 'ODBC Driver 17 for SQL Server'
      server: my_server\name
      port: 1433
      trusted_connection: True
      encrypt: False
      threads: 2
      database: my_db
      schema: my_local_schema

@yxl1108
Copy link
Author

yxl1108 commented Aug 14, 2023

I see you use trusted_connection here. doesn't this imply it's running on domain joined windows hosts? I am running dbt for sql server on ubuntu, which is not domain joined.

@NicolasPA
Copy link

Yes, it's all Windows.

@romiof
Copy link

romiof commented Feb 2, 2024

@yxl1108 as far I know, you need to login with a SQL Account.

AD Accounts, can only login to a SQL Server using Trusted Connection when you had logged with the same account at your machine.

At my setup, I have a dedicated SQL Account for dbt jobs.

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