pass env vars to all actions | Community
Skip to main content
Urs_Boller
Community Advisor
Community Advisor
September 27, 2020
Question

pass env vars to all actions

  • September 27, 2020
  • 8 replies
  • 2662 views

I have some .env variables I want to pass to all actions. Until now, I added the variables in question as params to all actions in the manifest.yml file. but too often I changed something and forgotten to change the manifest as well.

question: is there a way to have "real env variables", without adding them to all actions? I tried to use env vars starting with "__OW_" but that was not a success...

any hints hiw to do that?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

8 replies

Adobe Employee
September 28, 2020

just to clarify - do you want to use some custom params you set yourself, or the default params available as __OW_* ? For default params you could do e.g. `process.env.__OW_NAMESPACE` (but should be careful that you may accidentally expose your namespace credentials).

Urs_Boller
Community Advisor
Community Advisor
September 28, 2020
I have custom vars which I want to have access to in all actions. means any other solution than manually add them to all action params in the manifest.yml and the access the custom vars within the action.
Urs_Boller
Community Advisor
Community Advisor
September 28, 2020
example - as an idea: I define "__OW_CUSTOMVARS_myVarName" and then access the value with an action with "process.env.__OW_CUSTOMVARS_myVarName"
Adobe Employee
September 28, 2020
Ok - I don't think it is possible with I/O Runtime today, but agree that it's a very handy feature to have in "apps". Let me do some searches if any related enhancement ticket exists.
Urs_Boller
Community Advisor
Community Advisor
October 13, 2020
@duynpguyen do you have any updates on this?
Adobe Employee
October 14, 2020
@urs_boller - I don't have any update yet, but did bring it up for more elaborated discussions with the team. I hope to share a more insightful feedback to you within the next weeks.
Adobe Employee
October 14, 2020

Hi @urs_boller  - I just recall a way to share the variables across your actions without repeating it in the manifest per action.

Because all actions are placed under the `__APP_PACKAGE__`, you could also set the default params of the package. Then you are able to get them in each action, just in the same manner as setting default params per action.

This is not yet part of the manifest.yaml definition, but you could use the CLI, e.g. `aio runtime package update sample-app-0.0.1 --param name "Firefly"`.

Adobe Employee
October 15, 2020
I have created this GH issue for tracking purpose: https://github.com/adobe/aio-cli-plugin-runtime/issues/200