C# project, proxy and connectivity

Hello,

I am evaluating SonarCloud for our use in Azure DevOps project collection. Currently I am in dead end so I am looking for support:

  • We run mostly on self-hosted agents
  • On FW we can enable communication only to specific IP address
  • C# projects cannot communicate with sonarcloud.io, because either - I cannot open communication on name record sonarcloud.io and the steps cannot get any proxy configuration

Is there any suggestion what is possible to do in order to make SonarCloud integration work?

Many thanks.

Hey @Danielson,

As you can read on this thread Public IPs for SonarCloud, SonarCloud is a pure cloud service, hence IPs might change over time, depending on the location, load, etc.

So if you can’t have a FW rule based on the domain, your other option is a proxy.

Usually ADO tasks do not define their proxy, otherwise you’ll have to repeat that for each one reaching outside. It’s usually done at the agent OS level and there is nothing to do in the pipeline.
Though as you can read in our MSBuild scanner doc (Using SonarScanner for MSBuild with a Proxy, at the very end), you can use the environement variable SONAR_SCANNER_OPTS to:

  • either propagate system proxy settings to the task
  • specify these settings explicitely

I hope this will help.

Antoine

Hi Antoine,

Thank you for your answer. Issue I run into is same as described here Latest version of SonarCloud DevOps tasks (current do not work behind corporate proxy)

Even when there are those opts configured, the task just ignores them and goes without any proxy configuration. Address sonarcloud.io is accessible from self-hosted build server, but the build always fails.

Hi,

we are using SonarScanner for MSBuild 4.10 and have the same issue.

Regards,
Günter

Hey there,

After internal discussion, we realized that this topic has a global solution (the one I shared originally). If you have specific issues with proxy configuration, I invite you to open dedicated topics to troubleshoot them.
Please check the SonarScanner for MSBuild - Advanced topics page, paragraph Using SonarScanner for MSBuild with a Proxy to make sure you proceed as suggested here.

Cheers