Do proxy settings work with MSBuild Sonar Scanner?


  • SonarQube version: 7.9.3
  • SonarScanner for MSBuild: 4.10

My team is trying to run sonar analysis from a build machine behind the company proxy to a sonarqube instance on the cloud.
We tried to provide the proxy settings in SONAR_SCANNER_OPTS environment variable:

SONAR_SCANNER_OPTS="-Dhttps.proxyHost=<host> -Dhttps.proxyPort=<port> -Dhttps.proxyUser=<user> -Dhttps.proxyPassword=<password>" 

but it did not work and still throws this error: The remote server returned an error: (407) Proxy Authentication Required.
Using system level proxy settings is NOT an option for us since those are reset periodically by some policies in our organization.

I came across an issue on msbuild sonar scanner github:

  • Could you please confirm if there is indeed an issue with MSBuild sonar scanner wrt specifying the proxy settings in SONAR_SCANNER_OPTS?
  • If it is indeed an issue, when can we expect a resolution to this issue?
  • What are the other ways to provide proxy settings to MSBuild sonar scanner?



we also had this issue if a proxy server with authentication is required. Seems that the C# part of the scanner is not reading the proxy settings from SONAR_SCANNER_OPTS?

Sonar Scanner fails at begin command with error message HTTP 407 - Proxy Authentication Required


Do we have any resolution to this issue?