question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to connect to Azure SQL using Azure AD Credentials

See original GitHub issue

I have followed every guide I can find but cannot connect to my company’s Azure SQL DB. I believe everything in the cloud is working fine as I’m able to connect to the database using Azure Data Studio without issue.

I’m using the latest version of tedious v14.3 And using Node v16.13

My config looks like this…

const config = {
  authentication: {
    options: {
      userName: '<my ad username>',
      password: '<my ad password>' 
    },
    type: 'azure-active-directory-password' 
  },
  server: '<azure-server>.database.windows.net'
  options: {
    database: '<azure-database>',
    encrypt: true
  }
}

I’m getting a deprecation warning regarding not having a clientId, but I shouldn’t need one, and also don’t think the server has one in it’s current state. And I’m receiving the message “Security token could not be authenticated or authorized”

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:41 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
mShan0commented, Mar 18, 2022

type: azure-active-directory-default (DefaultAzureCredential) has been released on Tedious version 14.4.0

1reaction
mShan0commented, Mar 10, 2022

We’ve just merged PR #1365 which adds support for DefaultAzureCredential, but it hasn’t been released to NPM yet. In the meantime, you could continue using azure-active-directory-access-token as a workaround.

Also, could give this comment a look to see if that solves your issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to connect to Azure SQL using SSMS with Universal ...
I am unable to connect to Azure SQL Server using Active Directory - Universal with MFA option. The same credential works with Azure...
Read more >
Unable to connect to Azure SQL database via Azure AD user ...
that error message seems to imply that wherever you are running the query cannot reach the database. Maybe something in the Sql Server...
Read more >
Can't connect to Azure SQL DB using Azure Active Directory ...
Hi,. Testing DataGrip for our dev team and having difficulties connecting to our cloud sql server using Azure Active Directory auth.
Read more >
Cannot connect to Azure SQL Database - Support
Azure AD is a very different beast. To connect to Azure SQL with Windows identity, try using the ODBC connector, instead of the...
Read more >
Error When Connecting to Azure SQL Database via OAuth ...
Unable to connect to Azure SQL Database server "server name". ... If you use "Azure Active Directory via OAuth" authentication type, configure user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found