-
Notifications
You must be signed in to change notification settings - Fork 143
using environment var setting in ZE doc #4760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| # Using environment variables | ||
|
|
||
| Configure environment variables to supply values for properties in your team configuration file. | ||
|
|
||
| Environment variables in client configuration can be used to store credentials, or other sensitive connection data, such as host and port information. | ||
|
|
||
| ## Example use cases | ||
|
|
||
| - Working in **virtual environments** that do not store credentials locally. | ||
| - Create an environment variable for Zowe Explorer to use for authentication instead of looking in a local vault. | ||
| - Storing an **authentication token** for APIML. | ||
| - Store personal access tokens (PATs), which have longer durations than the default JSON web tokens. | ||
anaxceron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Configuring environment variables | ||
|
|
||
| To configure an environment variable: | ||
|
|
||
| 1. Enable the **Override With Environment Variables** option in Zowe Explorer settings. | ||
| 2. Add your environment variable and its value to your local system **[correct?]**. In Windows, go to System Properties. In MacOS, go to the system keychain **[correct?]**. | ||
anaxceron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Start the name with a `$` for Zowe to recognize it as an environment variable. For example, `$Environment_Variable`. | ||
anaxceron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| :::warning | ||
| Follow these naming guidelines to prevent unexpected behavior. | ||
|
|
||
| - Do not use the prefix `ZOWE_OPT` for these environment variable names. `ZOWE_OPT` is used to [format environment variables in Zowe CLI](./cli-using-formatting-environment-variables.md) and the prefix does not work in Zowe Explorer. | ||
|
||
| - Avoid names already in use on the by Zowe clients **[is "Zowe clients" correct here?]**. See [Configuring Zowe CLI environment variables](../user-guide/cli-configuringcli-ev.md) for a complete list. **[is "complete" correct here?]** | ||
anaxceron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ::: | ||
| 3. Open your `zowe.config.json` file and add the environment variable to the desired property. | ||
anaxceron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 4. Search for data sets, USS files, or jobs to confirm that the environment variable works. | ||
|
|
||
| ## A configuration file with environment variables | ||
|
|
||
| The following examples include environment variables in a configuration file with profiles organized in a nested structure (Lines 14-15, 24) and a configuration file with profiles in a flat structure (Lines 10-11, 23). | ||
|
|
||
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; | ||
|
|
||
| <Tabs> | ||
anaxceron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <TabItem value="nested" label="Nested profiles" default> | ||
| ```json showLineNumbers | ||
| { | ||
| "$schema": "./zowe.schema.json", | ||
| "profiles": { | ||
| "lpar": { | ||
| "properties": { | ||
| "host": "my.company.com", | ||
| "port": 1234, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming this is meant to be the z/OSMF port, I would move it into the |
||
| "rejectUnauthorized": false | ||
| }, | ||
| "profiles": { | ||
| "zosmf": { | ||
| "type": "zosmf", | ||
| "properties": { | ||
| // highlight-start | ||
| "user": "$ZOWE_USER", | ||
| "password": "$ZOWE_PASS", | ||
| // highlight-end | ||
| "authOrder": "basic" | ||
| }, | ||
| "apiml": { | ||
| "type": "zosmf", | ||
| "properties": { | ||
| "port": 7554, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put the API ML connection info (port, tokenType, tokenValue, and authOrder) in the lpar profile. Like we do it here: https://docs.zowe.org/stable/user-guide/cli-using-creating-profiles#accessing-services-through-multiple-api-ml-gateways |
||
| "basePath": "ibmzosmf/api/v1", | ||
| "tokenType": "apimlAuthenticationToken", | ||
| // highlight-start | ||
| "tokenValue": "$ZOWE_APIML_PAT", | ||
| // highlight-end | ||
| "authOrder": "token, bearer" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "defaults": { | ||
| "zosmf": "lpar.zosmf" | ||
| }, | ||
| "autoStore": false | ||
| } | ||
| ``` | ||
| </TabItem> | ||
| <TabItem value="flat" label="Flat profiles"> | ||
| ```json showLineNumbers | ||
| { | ||
| "$schema": "./zowe.schema.json", | ||
| "profiles": { | ||
| "zosmf": { | ||
| "type": "zosmf", | ||
| "properties": { | ||
| "host": "my.company.com", | ||
| "port": 1234, | ||
| "rejectUnauthorized": false, | ||
| // highlight-start | ||
| "user": "$ZOWE_USER", | ||
| "password": "$ZOWE_PASS", | ||
| // highlight-end | ||
| "authOrder": "basic" | ||
| } | ||
| }, | ||
| "apiml": { | ||
| "type": "zosmf", | ||
| "properties": { | ||
| "host": "my.company.com", | ||
| "port": 7554, | ||
| "rejectUnauthorized": false, | ||
| "basePath": "ibmzosmf/api/v1", | ||
| "tokenType": "apimlAuthenticationToken", | ||
| // highlight-start | ||
| "tokenValue": "$ZOWE_APIML_TOKEN", | ||
| // highlight-end | ||
| "authOrder": "token, bearer" | ||
| } | ||
| } | ||
| }, | ||
| "defaults": { | ||
| "zosmf": "zosmf" | ||
| }, | ||
| "autoStore": false | ||
anaxceron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| ``` | ||
| </TabItem> | ||
| </Tabs> | ||
Uh oh!
There was an error while loading. Please reload this page.