Cannot Authenticate with CLI
See original GitHub issueI am trying to use the SQL Server adapter with the CLI authentication. My config is the following :
dbt version: 0.18.1
dbt-mssql version: 0.18.1
python version: 3.7.4
os info: Windows-10-10.0.19041-SP0
Here is my profiles.yml
my_profile:
target: dev
outputs:
dev:
type: sqlserver
driver: 'ODBC Driver 17 for SQL Server'
server: ip_of_my_server
port: port_of_my_server
database: db_of_my_server_that_is_not_master
schema: my_schema
authentication: CLI
I run az login
sucessfully
You have logged in. Now let us find all the subscriptions to which you have access...
But when I run dbt debug
I encounter the following error :
Connection:
database: my_db
schema: my_schema
port: 1433
UID: None
client_id: None
authentication: CLI
encrypt: False
trust_cert: False
Connection test: ERROR
dbt was unable to connect to the specified database.
The database returned the following error:
>Database Error
('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user '<token-identified principal>'. (18456) (SQLDriverConnect); [28000] [Microsoft][ODBC Driver 17 for SQL
Server][SQL Server]Login failed for user '<token-identified principal>'. (18456)")
If I use :
authentication: ActiveDirectoryInteractive
user: me@github.com
It works but I have to authenticate at every command executed which is not efficient. Do you have any idea of what I could be doing wrong ? Or how we can fix this ?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Cannot authenticate using CLI even with correct credentials
I try to push my repo using the command line. A window pops up and asks for my login info, I enter it...
Read more >GitHub Error: Authentication Failed from the Command Line
Command line authentication requires a personal access token. Go to Settings: Then Developer Settings:.
Read more >Why can't I connect or authenticate with the Heroku Command ...
Verify that you're on the latest version of the Heroku Command Line by running heroku update . · Enable debugging during login. Make...
Read more >Unable to Authenticate With OpenStack CLI - Platform9
Cause. Special characters in the OS_PASSWORD environment variable set using the instruction available in the Platform9 document, Installing OpenStack CLI ...
Read more >Cannot authenticate to kubectl using the CLI on Windows - IBM
Run the C:\Users\<your_account>\. cloudctl\clusters\mycluster\kube-config. bat file. You can run kubectl commands against your cluster.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I actually just made it work by running
az logout
andaz login
. I tried to reproduce the issue but couldn’t. Sorry for the false alert. Hope it might help someone one day !Thanks a lot for your time and help @swanderz
@EatZeBaby thanksX1000 for the time to write up this issue. I have none of the normally-required follow up questions.
@mikaelene and @NandanHegde15 are the SQL Server Server experts here, but I’ll take a stab at this…
What version of SQL Server do you have? Where is it hosted? How is it connected to Azure?
I’m am by no means an expert, but my understanding is that you can only use the Azure CLI if your SQL Server db is associated with the Azure tenant. The two ways that I think this can be done is either by: