Unable to read environment variables using System.getenv() in azure VM

506 Views Asked by At

I’m trying to read environment variables using System.getenv() in a Java Spring boot application. I can read any env variable in my local but when I deploy my application to azure VM, System.getenv() returns null. Can someone please help.

Sample code I’m using:

public void printEnv(){
  System.out.println(System.getenv(“HOSTNAME”);
}
0

There are 0 best solutions below