1
votes

I have been trying to find out some nodejs code in order to connect from my nodeJs application to Azure SQL db via Azure AD authentication. But this will involve only my email Id. I don't have any Azure AD app as this will be from an email ID. I usually login onto my Azure SQL DB using my email Id and choosing the option 'Azure Active Directory-Universal with MFA' from MSSMS. Is there any way that we can replicate this from Code in NodeJs

1
If my answer is helpful for you, hope you can accept it as answer. This can be beneficial to other community members. Thank you.Leon Yue

1 Answers

2
votes

If you want to Use Azure Active Directory authentication for your Azure SQL database, you must configure Azure AD for it.

Please ref this tutorial: Configure and manage Azure AD authentication with Azure SQL

SSMS and SqlPackage.exe are the only tools currently enabled for MFA through Active Directory Universal Authentication.

For your question "Is there any way that we can replicate this from Code in NodeJs", the answer is no, there isn't. Node.js only support these types:

authentication.type

  • Type of the authentication method, valid types are default, ntlm, azure-active-directory-password, azure-active-directory-access-token, azure-active-directory-msi-vm, or azure-active-directory-msi-app-service

Ref: https://tediousjs.github.io/tedious/api-connection.html

HTH.