How to add an OAuth token to the Prepare Analysis task too authenticate with a proxy

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube hosted on-premise
    *CI process
    Azure Pipelines with SonarQube Extension

  • what are you trying to achieve
    We’ve set up a reverse proxy for our Azure Pipelines to talk through to our internal SonarQube server.
    The proxy requires an OAuth token, which we can retrieve prior to running the SonarQube Prepare Analysis task.
    I would like to know if we can pass the token, or if the token can be referenced, when making API calls to the SonarQube Server. This would allow us to authenticate with the proxy.

  • what have you tried so far to achieve this
    Tried replacing the SonarQube token in the Service Connection (didn’t expect this to work and it didn’t)
    Tried adding the token under ExtraProperties with no success.

My goal is to use the ADO SonarQube Extension to run our scans and post to the internal SonarQube instance.
Is this achievable?

Hi @ColtonH and welcome to the community !

Custom headers are not currently supported. The problem is that we need a Auth token to make authenticated calls against SonarQube, so that will certainly not work if you override it with an oauth bearer token.

What you can try is dealing with PROXY env variables available for Node.js request.


Ok, Thanks Mickael. I will check out the ENV variables for proxy configuration.