Creating an environment variable
Create an environment variable to store and manage a common value that you want to change for each environment.
When you create a variable in an environment, you must name it and assign a value to it for that environment. A variable of the same name is also then added to all other environments, but with a blank value that you must define.
To create an environment variable:
- Navigate to Settings > Environments.
- From the Environment pane, click the manage button for an environment (for example, Manage Production).
- Click the Variables tab.
- Click Create a new environment variable.
- Name: Enter a name for the variable. This is used when inserting the variable.
- Value: Enter the value for the variable. This value accepts any combination of alpha, numeric, and special characters.
- Value Kind: Select the desired Value kind:
- String. Type the string value in the Value field.
- Code. Select the code type as yaml, json or html from the drop-down and enter the value in the Value field.
- Is Secret: Select this radio button to specify that the value should be masked. On selecting this, the value will not be visible at designtime or runtime.
- Click Save to create the variable in the environment.
- Navigate back to Settings > Environments page and enter a value for the variable in each environment.
- A variable of the same name is added to all other environments, but with a blank value that you must now define.
- You can insert the contents of the variable into a number of areas, such as in an existing value, or into the content of a step. Refer to Inserting an environment variable.