Skip to content

Conversation

@anaxceron
Copy link
Collaborator

@anaxceron anaxceron commented Oct 23, 2025

Describe your pull request here: Addressing Issue 4682 to document how to use environment variables in a config file for ZE

List the file(s) included in this PR: docs\user-guide\ze-using-using-environment-variables.md, docs\user-guide\ze-install-configuring-ze.md

After creating the PR, follow the instructions in the comments.

@anaxceron anaxceron self-assigned this Oct 23, 2025
@anaxceron anaxceron added area: zowe-explorer Issues related to the VSC extension Zowe Explorer release: V3 Zowe V3 content review: sme Needs review by an SME labels Oct 23, 2025
@github-actions
Copy link

😺 Thank you for creating this PR! To publish your content to Zowe Docs, follow these steps.

  • Add the label review: sme if an SME needs to check your content.
  • Identify your content topic with a label. (Examples: area: apiml, area: cli, area: install and config, etc.)
  • Specify the major Zowe release(s) for your content. (Examples: release: V1, release: V2, release: V3)
    • If adding content that needs to be removed from V3 documentation, add the V3 N/A tag.
  • Link any Doc Issues related to this PR.
  • Fix broken links found in your content areas.
  • Notify the SME to review this PR (if applicable).
  • Merge to the master branch if your PR updates content that is on the live site. Merge to docs-staging if your PR updates content for a future release.

@github-actions
Copy link

github-actions bot commented Oct 23, 2025

@github-actions github-actions bot temporarily deployed to pull request October 23, 2025 18:38 Inactive
:::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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the Override With Environment Variables checkbox is checked, Zowe Explorer will use the values in $ZOWE_OPT_USER and $ZOWE_OPT_PASSWORD for user ID and password (regardless of what is in your config).

So, some ZOWE_OPT environment variables can be used by Zowe Explorer.

I might rephrase to something like: "If you need to connect to multiple LPARs using different credentials, do not use the ZOWE_OPT prefix for these environment variables. ZOWE_OPT is used by Zowe CLI to identify command options defined in environment variables."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the rephrasing might be more confusing.

If you only need one set of credentials, you can use the $ZOWE_OPT_USER and $ZOWE_OPT_PASSWORD environment variables, check the Override With Environment Variables setting, and be ready to connect to the mainframe.

If you need multiple sets of credentials, you should be sure to un-check the Override With Environment Variables setting, create your own non-ZOWE_OPT environment variables, add the environment variables to your config, and then be ready to connect to the mainframe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's a bit confusing either way. I like how you explained it here 🙏

If you only need one set of credentials, you can use the $ZOWE_OPT_USER and $ZOWE_OPT_PASSWORD environment variables, check the Override With Environment Variables setting, and be ready to connect to the mainframe.

If you need multiple sets of credentials, you should be sure to un-check the Override With Environment Variables setting, create your own non-ZOWE_OPT environment variables, add the environment variables to your config, and then be ready to connect to the mainframe.

Not sure how to condense all of that into the notes though 😋

:::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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's a bit confusing either way. I like how you explained it here 🙏

If you only need one set of credentials, you can use the $ZOWE_OPT_USER and $ZOWE_OPT_PASSWORD environment variables, check the Override With Environment Variables setting, and be ready to connect to the mainframe.

If you need multiple sets of credentials, you should be sure to un-check the Override With Environment Variables setting, create your own non-ZOWE_OPT environment variables, add the environment variables to your config, and then be ready to connect to the mainframe.

Not sure how to condense all of that into the notes though 😋


**In the nested structure**, the `zosmf` and `apiml` service profiles are nested within the `lpar` profile.
- This avoids repeating the `host` and `rejectUnauthorized` properties in both service profiles.
- Environment variables are used for [multiple credentials](#multiple-sets-of-credentials) in Lines 14-15 and Line 24.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adam-wolfe @zFernand0: Should we include a config example for ZOWE_OPT_USER and ZOWE_OPT_PASSWORD?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but I'm not sure about how it would with the API ML. I guess we could do something like:

{
    "$schema": "./zowe.schema.json",
    "profiles": {
        "lpar": {
            "properties": {
                "host": "my.company.com",
                "rejectUnauthorized": false
            },
            "profiles": {
                "zosmf": {
                    "type": "zosmf",
                    "properties": {
                        "port": 443
                    }
                }
            }
        }
    },
    "defaults": {
        "zosmf": "lpar.zosmf"
    },
    "autoStore": false
}

@github-actions github-actions bot temporarily deployed to pull request October 30, 2025 19:09 Inactive
"lpar": {
"properties": {
"host": "my.company.com",
"port": 1234,
Copy link
Member

Choose a reason for hiding this comment

The 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 lpar.zosmf profile properties.

"apiml": {
"type": "zosmf",
"properties": {
"port": 7554,
Copy link
Member

Choose a reason for hiding this comment

The 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: zowe-explorer Issues related to the VSC extension Zowe Explorer release: V3 Zowe V3 content review: sme Needs review by an SME

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

4 participants