Cloud foundry environment variables

ramnivas edited this page May 19, 2011 · 8 revisions

Cloud Foundry Environment Variables

Environment variables are the means by which the Cloud Foundry runtime communicates to the application about its environment. One of the most important pieces of information it communicates are the services which are available and how to connect with them.

Viewing the environment variables

If you go to you will see a raw listing of the environment variables.

Accessing and parsing environment variables within your application

  • node.js: Some sample code to parse the environment variables within a node.js application is available here
  • Java: The Spring cloud namespace parses the environment variables into a java.util.Properties object accessible inside a Spring container.

Description of environment variables


This defines the services that were bound to your application and how to access them.


You can read this information into your application using Java's environment variable API and/or existing Spring XML features but it is easer to consume this information using the new cloud namespace (described here) which parses it out into a convenient Properties object.


Defines the name of the application

VMC_APP_NAME: hello-spring