ActiveDirectoryServicePrincipal SQL Authentication


I’ve been working to install SonarQube Community 10.4.0 in our AKS environment but have been running into issues trying to use an Azure SQL PaaS database with ActiveDirectoryServicePrincipal authentication. I see that it’s been briefly discussed in the community forums before but I haven’t been able to find a solution or someone to confirm that it actually works with SonarQube. I kept running into the “Failed to load MSAL4J Java library for performing ActiveDirectoryServicePrincipal authentication.” error.

Microsoft has some example Java code in their documentation which I was able to run and confirm that I could connect to the database using ActiveDirectoryServicePrincipal authentication. I was initially seeing the same “MSAL4J Java library” error but I was able to resolve this by adding the msal4j.jar file to my project library.

It also works from SQL Server Management Studio (and no additional library has to be provided).

I decided to simplify things even further by setting SonarQube up in a Docker container on my local workstation which worked great using the integrated PostgreSQL database. However, when I tried to set up the docker container again using my SQL database with ActiveDirectoryServicePrincipal authentication, I again kept running into the “MSAL4J Java library” error.

I then tried to put my MSAL4J.jar file in sonarqube_extensions/jdbc-driver/oracle (I tried several other directories as well) but I’m still getting the “MSAL4J Java library” error.

Has anyone successfully configured SonarQube with ActiveDirectoryServicePrincipal to a SQL database? Just curious to see if it’s possible or we’re just wasting our time on this.


Welcome to the community!

Sorry, but integrated security is as far as we’ve gotten.