Skip to main content
Level 2
Nov 23, 2023 7:30 PM UTC
Solved

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

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.
rishim22446870
rishim22446870Accepted solution
Adobe Employee
Apr 12, 2024 9:33 AM UTC

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.

2 replies

rishim22446870
Adobe Employee
rishim22446870Adobe EmployeeAccepted solution
Adobe Employee
Apr 12, 2024 9:33 AM UTC

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.

Translate
Adobe Employee
Sep 4, 2024 1:40 PM UTC

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

Translate