Cannot access on-premises SonarQube from cloud Azure Devops


I cannot contact my on-premises SonarQube from my cloud-version Azure DevOps:

Here’s the error on my Azure Build Pipeline:
##[debug][SQ] API GET ‘/api/server/version’ failed, error was: {“code”:“ETIMEDOUT”,“errno”:“ETIMEDOUT”,“syscall”:“connect”,“address”:“”,“port”:9002}

My on-premises SonarQube is internal (accessible only through VPN) but as I installed an Azure agent on this machine (where Azure is already automatically publishing my websites) didn’t need anything else to become accessible from Azure DevOps.

What am I missing? Any help will be highly appreciated!

Although it is possible to use the agents to publish a website on an internal server (only accessible by VPN), Sonarqube isn’t prepared to work in a similar fashion (uploading the necessary files from Azure DevOps).

There are only 2 solutions to this problem:

  • Create an exception on your VPN, authorizing the access to the Sonarqube port. This solution has security constraints.
  • Use SonarCloud (SonarQube cloud version) instead of SonarQube. This solution might have an associated cost, as the SonarCloud free version forces us to share our code with the public. Only the paid version ensures your code remains private.