How to store secret keys in AEM cloud and use them in Cloud configurations as $[env:SITE_KEY] | Community
Skip to main content
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 joerghoh

No, you cannot do that. 

2 replies

Harwinder-singh
Community Advisor
Community Advisor
November 23, 2023

@rohan0794 You can store these as configuration entries in the cloud manager and then use the same in the OSGI configs. More details here - 

https://medium.com/@toimrank/aem-as-a-cloud-service-osgi-configuration-secret-and-environment-variables-667a0ddfb1d5

 

aanchal-sikka
Community Advisor
Community Advisor
November 24, 2023

Hello @rohan0794 

 

1. We need to store the variable as a Secret in Cloud Manager for that specific environment.

 

2. We need to specifiy that its a secret, in OSGi config.

  • ${secret.VARIABLE_NAME}

3. Make sure that the OSGi configuration is picked up in the environment. Verify the active configuration via Developer console in CM.

Aanchal Sikka
Rohan0794Author
Level 2
November 24, 2023

I am aware that we can store in Cloud manager and retrieve in OSGI using the above syntax but can we access the environment variable or secret in JCR properties directly using $[env:<variable_name>]?



joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
November 25, 2023

No, you cannot do that.