Accessing environment variables

Hi there, We have an app running in an Azure Web App Service and we need to access an environment variable set by Azure. We don't have any control over the name of the variable, and as such we have no way to pass it through to Mendix using the Mendix build pack. Is the only way to access this variable via a custom Java action using the Java utility function System.getenv(), or is there an existing module or Mendix API call that can do this for us? I couldn’t find anything in the Community Commons library or the Mendix Core API. Thanks! Andrew  
2 answers

For the environment variables used, I’m not aware of any way to retrieve them except Java's System.getenv().


It sure seems to me like a Java action is the right solution here. I think it’s just one line:


  • Input: varName – String
  • Output: String


return System.getenv(varName);