Set AEM Local Environment and Secret Variables AEMaaCS

As an AEM developer developing for the AEMaaCS SDK, it’s essential to have a local environment properly set up for development purposes. You may encounter environment-specific and secret variables in your OSGI configuration files. As an AEM developer trying to familiarize new features of the AEMaaCS SDK development environment, setting up environment-specific and secret variables is non-trivial at first. Once you have done it once, it will be much easier to move forward.

In this article, I will show you how to set up environment-specific and secret variables. If you would like to understand when to use environment-specific and secret variables effectively, check out the official AEM Adobe git documentation. At the end of this article, you are equipped to run your AEM local development environment with environment-specific and secret variables!

One last thing, it looks like only AEMaaCS SDK has environment-specific and secret variables feature enabled for OSGI configurations.


Examples of what OSGI configurations would look like with environment and secret variables set in your code base:

Environment-specific variable
high-level use-case: Values that are specific to a particular environment and may vary between different development environments cannot be targeted accurately by run mode, as AEMaaCS only has a single development run mode. For instance:

1
2
3
{
   "url": "$[env:SERVER_API_URL]"
}

Secret variable
high-level use-case: Sensitive information, such as confidential data or authentication credentials, should not be stored in Git repositories due to security concerns. For instance:

1
2
3
{
   "api-key": "$[secret:SERVER_API_KEY]"
}

Example of an OSGI configuration with the combination of the environment-specific and secret variables being used:

1
2
3
4
5
{
   "connection.timeout": 1000,
   "api-key": "$[secret:SERVER_API_KEY]",
   "url": "$[env:SERVER_API_URL]"
}
Please note that environment-specific and secret variables allow defaults, so if your environment is not set up properly with the right configuration, it will use the default settings.

1
2
3
4
5
6
{
   "connection.timeout": 1000,
   "api-key": "$[secret:SERVER_API_KEY;default=https://api.sourcedcode.com"]",
   "
url": "$[env:SERVER_API_URL;default=23u1kn1jbkjs789fds8f_ewrqasd]"
}
From the <a href="
https://github.com/AdobeDocs/experience-manager-cloud-service.en/blob/main/help/implementing/deploying/configuring-osgi.md" rel="noopener" target="_blank">documentation</a>, it looks like only AEMaaCS has environment-specific and secret variables feature enabled for OSGI configurations.

So how we can actually set these environments and secret variables into AEM? Well, it’s simple. We will be using a Linux environment to set this up. In the examples below, we will be setting up one environment-specific variable and one secret variable.

  • $[env:SERVER_API_URL]
  • $[secret:SERVER_API_KEY]
1
2
3
4
5
{
   "connection.timeout": 1000,
   "url": "$[env:SERVER_API_URL]"
   "api-key": "$[secret:SERVER_API_KEY]",
}

1. set AEM Environment variables on local AEM instance

  1. Close down your local AEM environment.
  2. open git bash or terminal.
  3. cd to the AEM folder, where the executable jar file exists.
  4. run export SERVER_API_URL=https://api.sourcedcode.com
  5. run echo ${SERVER_API_URL}// you should see the environment variable being set as this call will echo out what the environment variable is for SERVER_API_URL.
  6. now restart your local AEM environment.
  7. done.

2. set AEM Secret variables on local AEM instance

  1. Close down your local AEM environment.
  2. open git bash or terminal.
  3. cd to the AEM folder, where the executable jar file exists.
  4. run vim ./crx-quickstart/conf/quickstart.properties
  5. add this to the last line org.apache.felix.configadmin.plugin.interpolation.secretsdir=${sling.home}/secretsdir
  6. save in vim.
  7. run mkdir ./crx-quickstart/secretsdir
  8. run cd ./crx-quickstart/secretsdir
  9. run echo “23u1kn1jbkjs789fds8f_ewrqasd” > SERVER_API_KEY
  10. repeat the step-9 to add more secret variables into your AEM local environment. run echo “secret_value” > secret_key
  11. You may have more than 1 secret variable stored in the secretsdir folder: Example of showing many instances of secret variables declared
  12. now restart your local AEM environment.
  13. done.

Hello, I am an enthusiastic Adobe Community Advisor and a seasoned Lead AEM Developer. I am currently serving as an AEM Technical Lead at MNPDigital.ca, bringing over a decade of extensive web engineering experience and more than eight years of practical AEM experience to the table. My goal is to give back to the AEM Full Stack Development community by sharing my wealth of knowledge with others. You can connect with me on LinkedIn.

3 thoughts on “Set AEM Local Environment and Secret Variables AEMaaCS

  1. I was trying this for windows the secret variables are not taking. Do I need to change anything to make it work in windows machine?

Leave a Reply

Your email address will not be published. Required fields are marked *


Back To Top
xx1toto
xx1toto
slot toto
situs toto slot
xx1toto
situs toto
slot toto
Scatter Hitam
Situs toto
toto slot
Scatter Hitam
bandar togel, situs toto slot
bacan4d
toto slot
Situs Toto Slot
situs slot gacor
situs toto slot
Slot Mahjong
xx1toto
situs slot gacor
Situs Toto
xx1toto
xx1toto, Situs Toto Slot
xx1toto
bacansport
bacan4d
xx1toto, situs toto slot, bandar casino
xx1toto, situs toto slot, bandar casino
xx1toto, situs toto, toto slot
xx1toto, Situs Toto Slot
Link Situs Toto Slot
scatter hitam
xx1toto, situs toto, tabel shio
Situs Scatter Hitam Mahjong Wins 3
xx1toto
xx1toto, situs toto slot, bandar togel
situs toto slot
scatter hitam, black scatter, mahjong wins 3
mahjong scatter
situs toto
black scatter, mahjong wins 3
xx1toto
xx1toto
bacan4d
xx1toto, situs toto
bacansport
bacansport
xx1toto
bacansport
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
slot gacor bacan4d
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
Situs Toto, Toto Slot
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
bacansport
xx1toto
bacan4d
xx1toto
xx1toto
bacan4d login situs toto
situs toto slot
linkbacan4d
bacan4d
bacan4d
bacansports
bacan4dslot gacor<
xx1toto
xx1toto
bacan4d
bacan4d
scatter hitam
xx1toto
xx1toto
xx1toto
bacan4d
bacan4d situs toto macau
bacan4d slot gacor x1000
xx1toto scatter hitam
xx1toto
xx1toto
xx1toto
bacan4d slot gacor 2024
bacansport
bacan4d game slot gacor
ts77casino bet 200
bacansport
aplikasi slot
xx1toto scatter hitam
bacan4d login
bacan4d login situs slot gacor
situs toto
xx1toto
xx1toto
bacansport
bacan4d
xx1toto
xx1toto
slottoto
xx1toto
bacan4d login slot gacor
bacan4d slot
ts77casino
ts77casino
ts77casino
ts77casino
Scatter Hitam
Situs Toto
toto slot
Scatter Hitam
Situs Toto
toto slot
bacan4d situs slot toto
scatter hitam
slot mahjong wins 3
mahjong wins 3 black scatter
scatter hitam
ts77casino
ts77casino
tabel shio 2025
bacan4d slot sever thailand
akun slot bet 400
bacan4d slot gacor toto
instagram bacansports
situs toto
bacan4d slot toto
scatter hitam
Situs Toto
scatter hitam
slot bet kecil
bacansports taruhan bola
slot gacor
facebook bacan4d
Demo Slot
Situs Toto
toto togel
Toto slot gacor
slot gacor bett 200
situs toto
situs toto
bacan4d situs toto 176
bacan4d slot toto 2025
bacansport
situs slot toto
Situs Toto Slot
Bacansports
Bacantoto Situs Toto Slot
xx1toto
xx1toto
xx1toto, situs toto slot
bacan4d
Situs Toto Slot, Situs Togel, toto slot, xx1toto
scatter hitam
Situs Toto Slot, Bandar Togel, Toto macau
Slot Toto
xx1toto, Login Situs Toto
xx1toto, Situs Toto Slot
Situs Toto Slot, Agen Toto Slot 4D, Tabel Shio
xx1toto, situs toto, toto slot, bandar togel
xx1toto, situs black scatter hitam
Situs Toto Slot, Bandar Togel
xx1toto, situs toto
Situs Toto Slot
Situs Toto Slot
Slot Toto
situs toto slot
bacan4d situs idn slot
bacansports
situs toto slot
bacansport
situs toto slot
situs slot terbaru
agen toto, situs toto
situs toto slot
situs toto slot
situs toto slot
bacan4d
bacan4d
bacan4d
situs toto slot
situs toto slot
Slot Mahjong, Scatter Hitam
xx1toto, situs toto slot
situs toto
situs toto
bandar togel, situs toto slot
toto slot
Bacan4d Login Situs Slot Toto
Bacan4d Login Toto Slot
Bacan4d Situs Toto Slot
Link Alternatif Bacan4d Situs Toto Slot
Bacan4d Slot Gacor
Bacan4d Slot Bet 400
Bacantoto Situs Slot
BACANTOTO Situs Toto
toto slot
bacansport
Toto Slot
Bacan4d login
Slot Toto
BACANSPORTS | Slot Gacor Games
Slot Toto
Situs toto
bacansport
Slot toto
bacansport
bacansport
bacansport
bacansport
bacansport
Bacan4d Link Alternatif
Bacan4d Rtp Slot
bacan4d
ts77casino
taruhan bola
ubobet bola
bacansport
situs taruhan bola indonesia
situs taruhan bola
taruhan bola
judi bola