How to access Environment Variables from AEM as Cloud Service using Java/JSP/JS without OSGI config | Community
Skip to main content
Level 2
November 23, 2023
Solved

How to access Environment Variables from AEM as Cloud Service using Java/JSP/JS without OSGI config

  • November 23, 2023
  • 1 reply
  • 1601 views

I want to use the value of any environment variable configured in AEM as Cloud Service through Java or JSP or JS file. 
NOTE: I don't have any OSGI config. I am trying to get the secret keys stored as environment variables in Cloud configuration (ReCaptcha).
Any help is appreciated.

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

To utilize the environment variable within your Java code, you'll first need to establish an OSGi configuration. This configuration would enable you to access the environment variable through $[env:<variable_name>]. Subsequently, you can consume the OSGi property within your Java code.

1 reply

rishim22446870
Adobe Employee
rishim22446870Adobe EmployeeAccepted solution
Adobe Employee
April 12, 2024

To utilize the environment variable within your Java code, you'll first need to establish an OSGi configuration. This configuration would enable you to access the environment variable through $[env:<variable_name>]. Subsequently, you can consume the OSGi property within your Java code.

Adobe Employee
September 4, 2024

So without osgi configuration, we cannot access the environmental variable?