Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Reading Cloud Manager Environment Variables in Cypress UI test script


Level 5

hi all,


I'm struggling to find a way to read env. variables set on the cloud manager configuration and provide them in cypress script during pipeline execution.

Also, another option would be to define vars as part of the osgiconfig module and access it from there.


Thank you

5 Replies


Level 6

Two possible lines that I can suggest.


const myVariable = process.env.MY_VARIABLE;


const myVariable = Cypress.env('MY_VARIABLE');

 For testing set env variable on your local and try to read with one of the line.

Cloud manager env variables are like other env variables. You can read it if your application is running on the same instance.


Level 5

Thank you,


I believe this doesn't work because we have it used in the same way, it's always taking localhost one. 


const authorURL = process.env.AEM_AUTHOR_URL || "http://localhost:4502";


We used cypress sample from the Weekend git, config is defined under, cypress.config.js


Level 6

Is it running on same instance?
and do the user have access to read all env variables? because adobe gives specific permission to user



Level 5

That is valid question, It is running as the part of the Cloud pipeline so I'm not sure if env vars are available during pipeline run... so I would say that running on the same instance question is not the valid one ?

Regarding user having access, again not sure because it's part of the cloud pipeline






@nbg62 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni