コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.
解決済み

AEMaaCS | Unable to read cloud environment and secret variables from AEM cloud in AEM OSGI config

Avatar

Level 1

Hi,
cc @kautuk_sahni 
I am unable to read the environment and secret variables from AEM cloud in my OSGI config (ui.config/src/main/content/jcr_root/apps/proj/osgiconfig/config.author.dev/com.proj.service.impl.ServiceImpl.config.cfg.json)

{
    "apiUrl": "$[env:EFIX_BACKEND_URL;default=https://some.value.foo/bar]",
    "secretKey": "$[secret:EFIX_BACKEND_USER]",
    "secretVal": "$[secret:EFIX_BACKEND_PASSWORD]",
    "timeout:Integer":1000
}


We have the environment and secret variables from AEM cloud author as below:

aemEon_0-1697748556027.png

Am i missing something? 

トピック

トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。

1 受け入れられたソリューション

Avatar

正解者
Community Advisor and Adobe Champion

The variable definition looks correct. I would suggest checking how you are retrieving the values. Please look at this post, which has a full example of how to use the variables once set up https://medium.com/slalom-technology/how-to-use-environment-variables-in-adobe-experience-manager-ae... 



Esteban Bustamante

元の投稿で解決策を見る

6 返信

Avatar

Community Advisor and Adobe Champion

Can you verify you don't have a run mode selection conflict?

Something like another config under ui.config/src/main/content/jcr_root/apps/proj/osgiconfig/config.author/com.proj.service.impl.ServiceImpl.config.cfg.json

 

 



Esteban Bustamante

Avatar

Level 1

@EstebanBustamante  thanks for your response. 
On AEM Cloud DEV we can see the config for the pid com.proj.service.impl.ServiceImpl.config which confirms the runmode is fine, but these osgi config values with expression are not getting replaced from the cloud environment and secret variables as we can see in logs the StringUtils.isNotBlank() is returning false for the config value in service. 

Avatar

正解者
Community Advisor and Adobe Champion

The variable definition looks correct. I would suggest checking how you are retrieving the values. Please look at this post, which has a full example of how to use the variables once set up https://medium.com/slalom-technology/how-to-use-environment-variables-in-adobe-experience-manager-ae... 



Esteban Bustamante

Avatar

Employee

Hi,

The steps mentioned in https://medium.com/slalom-technology/how-to-use-environment-variables-in-adobe-experience-manager-ae... are not working for me. I am getting null values although I am entering the value under Configuration in the program.

Avatar

Administrator

@EstebanBustamante 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

Avatar

Level 4

I know this post is 2 years old, but I'm encountering the same issue.
Were you able to resolve it? If so, could you please share the details?