Hi @Victor Coupez , It seems that you are trying to connect an on-prem application (SonarQube) with an Azure managed SQL DB using JDBC v12.2.0. You mentioned that the connection works using a SQL User and password, but does not work with Authentication=ActiveDirectoryIntegrated. The error message "Failed to authenticate the user in Active Directory (Authentication=ActiveDirectoryIntegrated)" indicates that the authentication failed. According to the documentation, the Active Directory Integrated authentication requires that the client and server are in the same domain or in trusted domains. If the client and server are not in the same domain or in trusted domains, you can use Active Directory Password authentication or Active Directory Universal authentication. You mentioned that the application making the connection runs as a Windows Service using a service account. The service account in AD is synced with AAD. The service account is a user in the DB in db_datareader, db_datawriter, db_ddladmin, db_securityadmin roles. Based on the information you provided, it seems that you are using a service account to connect to the Azure SQL DB. In this case, you can use Active Directory Password authentication. You can create an Azure AD user and assign it to the db_datareader, db_datawriter, db_ddladmin, db_securityadmin roles in the Azure SQL DB. Then, you can use the Azure AD user's credentials to connect to the Azure SQL DB. Here is an example of a connection string that uses Active Directory Password authentication:
jdbc:sqlserver://<server-name>.database.windows.net:1433;database=<database-name>;user=<user-name>@<domain-name>.onmicrosoft.com;password=<password>;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;
Please replace the <server-name>
, <database-name>
, <user-name>
, <domain-name>
, and <password>
placeholders with the appropriate values.
I hope this helps! Let me know if you have any further questions.
If this answer helped you please mark it as "Verified" so other users can reference it.
Thank you,
James