Assigning a Dynamic Port at Startup to SonarQube Server

Hello,

Is there a way to assign the port the SQ server uses from the command line or use environment variables in the sonar.properties 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 sonar.properties I get an " Value of property sonar.web.port is not an integer" exception. Is there another way to go about this?

Thanks,

-Nate

HttpPlatformHandler Docs:

Hi Nate,

Sorry, but this is not something we support.

 
Ann

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 sonar.properties file.

The project can be found here: https://github.com/vanderby/SonarQube-AzureAppService

1 Like

Hi Nate,

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

 
Ann