Connections from BAS through the SAP Cloud Connector

Hi,

For test purposes, we have installed SonarQube Community in an on-premises environment. Our question is: Does the VCS IDE plugin support connections from BAS through the SAP Cloud Connector to on-premises systems?

Regards,

Artur

Hello @Artur_K,

I’m not very familiar with SAP Cloud Connector and BAS, but from what I can read on the topic, in theory it should be possible. This page seems to be a good start: Connecting to External Systems From the Business Application Studio | SAP Cloud SDK

The connectivity proxy running in BAS expects a pattern of the kind http://<destinationName>.dest

I think you should be able to use this URL when creating a SonarQube Server connection in SonarQube for IDE, as you would use any other URL.

I cannot test this myself, so all this is theoretical.

Please let us know if you manage to make it work!

Cheers

Hello
Thank you for the response.
I have checked this before, but doesn’t work.

No idea why, I’m able to reach SonaQube server from BAS terminal with curl, but New SonarQube Server Connection can’t be created.
Regards
Artur

Hi
works now - thanks to Gemini :slight_smile:

Step 1: SAP BTP Destination Configuration

First, define the connectivity in your SAP BTP Subaccount.

  • Destination Name: Must match the exact prefix used in your IDE URL. For example, if you want to use [``http://SonarQube.dest``](``http://SonarQube.dest``), your destination must be named exactly SonarQube.

  • Proxy Type: OnPremise (routing via SAP Cloud Connector).

  • Additional Properties: You must manually add the following two attributes to expose this destination to the BAS internal proxy:

    • WebIDEEnabled = true

    • HTML5.DynamicDestination = true

Step 2: BAS Environment Configuration (Remote Settings)

Because SonarLint relies on a background Java process (Language Server), it completely ignores the standard User proxy settings. You must force the JVM inside your cloud Dev Space to route traffic through the internal BAS proxy sidecar via the Remote settings tab.

  1. Open the Settings UI by clicking the Gear Icon (:gear:) in the bottom-left corner and selecting Settings (or press Ctrl + ,).

  2. At the top of the Settings tab, click on the Remote tab (as shown in image_e9a71e.png) to ensure the configuration applies to your cloud environment.

  3. In the search bar, type vmargs.

  4. Under the Sonarlint › Ls: Vmargs section, paste the following arguments into the input field to bind the SonarLint JVM to the BAS local proxy host (127.0.0.1:8887):

    Plaintext

    -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8887 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8887 -Dhttp.nonProxyHosts="localhost|127.0.0.1"
    
    
5. *(Optional)* Click the **Open Settings (JSON)** icon in the top-right corner if you prefer to verify your `settings.json` file directly. It should contain:
   ```json
   {
       "http.proxy": "http://127.0.0.1:8887",
       "http.proxyStrictSSL": false,
       "sonarlint.ls.vmargs": "-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8887 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8887 -Dhttp.nonProxyHosts=\"localhost|127.0.0.1\""
   }

  1. Apply Changes: Restart the developer window to boot the Language Server with these new JVM arguments. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac), type Developer: Reload Window, and hit Enter.

Step 3: SonarLint Plugin Setup

Now that the network tunnel is fully operational, you can establish the connection within the UI:

  • Go to the SonarLint Setup panel on the left activity bar.

  • Click Connect to SonarQube Server.

  • In the Server URL field, enter the virtual destination address: [``http://SonarQube.dest``](``http://SonarQube.dest``).

  • Provide your User Token, name your connection, and hit Save Connection.

The traffic will now be successfully intercepted by the BAS proxy, mapped to your BTP SonarQube destination, and securely tunneled over the Cloud Connector straight to your on-premise server.

result

And last thing

user: <some directory> $ cat sonar-project.properties
sonar.projectKey=<project_name>
sonar.projectName=<project-key>
sonar.host.url=https://SonarQube.dest
sonar.token=<token>
sonar.projectVersion=1.0
sonar.sources=.
sonar.sourceEncoding=UTF-8
sonar.exclusions=/node_modules/, /dist/, **/*.spec.js
sonar.qualitygate.wait=true
http.proxyHost=127.0.0.1
http.proxyPort=8887

Regards
Artur

Thanks a lot for sharing this @Artur_K, it might help other people!