Assigning a Dynamic Port at Startup to SonarQube Server

(Nathan Vanderby) #1


Is there a way to assign the port the SQ server uses from the command line or use environment variables in the file? I am trying to utilize the HttpPlatformHandler module in IIS to host the SQ server. This module forwards requests to the self hosted process on a port that is dynamically assigned at startup. This port is assigned to the environment variable HTTP_PLATFORM_PORT. The end state goal is to host SQ on an Azure App Service resource without needing a Linux container.

If I try assigning the environment variable in the I get an " Value of property sonar.web.port is not an integer" exception. Is there another way to go about this?



HttpPlatformHandler Docs:

(G Ann Campbell) #2

Hi Nate,

Sorry, but this is not something we support.


(Nathan Vanderby) #3

Thanks for the quick reply. I found a way to do this by executing a script before starting SQ that reads the environment variable and sets the file.

The project can be found here:

(G Ann Campbell) #4

Hi Nate,

Thanks for the followup. I’ve added your project to the Other Contributions page.