-
Notifications
You must be signed in to change notification settings - Fork 10
Create a user defined environment variable in Bluemix
Add an environment variable to your Simple Data Pipe app in one of 2 ways. You can:
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.
-
If this is the first time you are using the Cloud Foundry command line interface, download and install the software.
-
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 logoutcommand. You therefore don't have to log in every time you want to use the command line interface.
- Create an environment variable named weather and assign a value of
my\_weather\_service\_instance\_nameby entering the following command:
$ cf set-env simple-data-pipe weather my_weather_service_instance_name
- Restage the application.
$ cf restage simple-data-pipe
- 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).
-
Open Bluemix and log in using your IBM ID.
-
Open the DASHBOARD.
-
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.
-
Locate the Simple Data Pipe application tile and click it.
-
From the right-hand menu, select Overview > Environment Variables.
-
Click the USER_DEFINED tab.
-
Click ADD.
-
Enter the desired Name and Value.
-
Click SAVE.
-
Return to the DASHBOARD.
-
Locate the Simple Data Pipe application tile and click on the cog on the right hand side.
-
From the drop down menu select Restart App.