Unable to connect to Azure SQL using Azure AD Credentials
See original GitHub issueI 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:
 - Created 2 years ago
 - Comments:41 (9 by maintainers)
 
Top 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 >
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

type: azure-active-directory-default(DefaultAzureCredential) has been released on Tedious version 14.4.0We’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-tokenas a workaround.Also, could give this comment a look to see if that solves your issue.