Skip to content
This repository has been archived by the owner on Feb 7, 2018. It is now read-only.

Create a user defined environment variable in Bluemix

Jess Mantaro edited this page Feb 9, 2016 · 3 revisions

Add an environment variable to your Simple Data Pipe app in one of 2 ways. You can:

##Use Cloud Foundry

The following example illustrates how to create an environment variable WEATHER weather service instance and bind it to the Simple Data Pipe (simple-data-pipe) application.

  1. If this is the first time you are using the Cloud Foundry command line interface, download and install the software.

  2. Open a command prompt and connect to Bluemix, by following the prompts.

$ cf login

Tip: You remain logged in until you explicitly log out using the cf logout command. You therefore don't have to log in every time you want to use the command line interface.

  1. Create an environment variable named weather and assign a value of my\_weather\_service\_instance\_name by entering the following command:
$ cf set-env simple-data-pipe weather my_weather_service_instance_name 
  1. Restage the application.
$ cf restage simple-data-pipe
  1. Verify that the environment variable is set for the application.
$ cf env simple-data-pipe

##Use the Bluemix user interface

How to create a user-defined environment variable in the Bluemix web user interface (for a previously deployed Simple Data Pipe application).

  1. Open Bluemix and log in using your IBM ID.

  2. Open the DASHBOARD.

  3. Select the space into which the Simple Data Pipe application has been deployed.

Tip: If you cannot locate the space, make sure you are using the correct org.

  1. Locate the Simple Data Pipe application tile and click it.

  2. From the right-hand menu, select Overview > Environment Variables.

  3. Click the USER_DEFINED tab.

  4. Click ADD.

  5. Enter the desired Name and Value.

  6. Click SAVE.

  7. Return to the DASHBOARD.

  8. Locate the Simple Data Pipe application tile and click on the cog on the right hand side.

  9. From the drop down menu select Restart App.