Will this work for a Service Principal or for an MFA-enabled user?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi @Ayanmullick
Azure Active Directory authentication for MFA-enabled user is not supported with MSSQL JDBC Driver.
You can find samples and details on supported authentication modes with Azure here. If by Service Principal you mean SPN as used in this example, it can be used to acquire access token which can be further used for authentication with JDBC Driver. You may notice Client ID and Client Secret required here are to be configured as explained here.
Furthermore if you can explain with a sample code what exactly are you trying to connect with, we can clarify better.
Thanks!
@Ayanmullick Thank you for the detailed inquiry. The Use Java to query Azure SQL Database uses SQL Authentication, but the following document walks you through Azure Active Directory Authentication with Azure SQL Database using a Java client and all supported Auth types: Connecting using Azure Active Directory Authentication
Please let me know if you have any additional questions. The above document is specific to AAD.
@cheenamalhotra , for sharing the link. In my opinion, that link should be added to the Next Steps section of this document.
Most helpful comment
Hi @Ayanmullick
Azure Active Directory authentication for MFA-enabled user is not supported with MSSQL JDBC Driver.
You can find samples and details on supported authentication modes with Azure here. If by Service Principal you mean SPN as used in this example, it can be used to acquire access token which can be further used for authentication with JDBC Driver. You may notice Client ID and Client Secret required here are to be configured as explained here.
Furthermore if you can explain with a sample code what exactly are you trying to connect with, we can clarify better.
Thanks!