Environment specific configuration for Adobe IO runtime project

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)

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