Environment specific configuration for Adobe IO runtime project

Avatar

Avatar

Sharma_Shruti

Avatar

Sharma_Shruti

Sharma_Shruti

13-05-2020

Requirement : We need to create and read environment specific configurations on Adobe IO project i.e WCS Commerce API urls and different namespace based on different environment(Dev, Prod) 

We followed steps provided in document 

https://www.adobe.io/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/get...

Steps:

1- Created .env file in workspace.

2- Provided AIO_RUNTIME_APIHOST , AIO_RUNTIME_AUTH and AIO_RUNTIME_NAMESPACE

3- Deployed code base .

Issue 1: Unable to pick credentials provided in .env file.

Issue 2: How to read environment specific variables in node.js code base . 

 

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar

sarahxxu

Avatar

sarahxxu

sarahxxu

15-05-2020

Hi @Sharma_Shruti 

Are you configuring the wsk cli or the aio cli?

The .env file only applies if you are configuring the Adobe I/O CLI. After you create the `.env` file within the current working directory, update it with your Runtime credential and save the file. When you are in this directory, and type in `aio runtime property get`, all the values should be automatically picked up and shown here. You can proceed to execute any `aio runtime` commands, including deployment commands. 

Alternatively, if you already have a `.wskprops` file in your root directory, the Adobe I/O CLI picks that up automatically as well.

Hope this helps.

Sarah

Avatar

Avatar

Mihai_Corlan

Employee

Avatar

Mihai_Corlan

Employee

Mihai_Corlan
Employee

18-05-2020

On issue #1 Sarah Xu already answered. On issue #2, can you give us more details about what you are trying to do?