Expand my Community achievements bar.

Externalizer configuration values are not working AEM cloud Environment

Avatar

Level 2

Hi Team,

I create Externalizer configuration kept in config.publish folder , then i override that value through  AEM cloud environment variables , Its not pick whatever authored in environment config value 

Screenshot 2023-07-30 at 8.55.40 PM.png
// Configuration created by Apache Sling JCR Installer
{
"externalizer.domains":[
"local $[env:AEM_EXTERNALIZER_LOCAL;default=http://localhost:4502]",
"author $[env:AEM_EXTERNALIZER_AUTHOR;default=http://localhost:4502]",
"publish $[env:AEM_EXTERNALIZER_PUBLISH;default=http://localhost:4504]",
"preview $[env:AEM_EXTERNALIZER_PREVIEW;default=http://localhost:4503]",
""
]
}
@BrianKasingli  @aanchal-sikka  @EstebanBustamante  @Nishant-Singh  @DPrakashRaj.  @Sady_Rifat 

 

8 Replies

Avatar

Community Advisor

How do you know that CM values are not being picked up? Is it falling back to default value from OSGI config?

once you add/update the CM values it take some time to get it updated on the environment approx 15 min.

Avatar

Level 3

@DPrakashRaj  Configured  CM values updated after that only tested but still take's only corresponding publish URL.

Avatar

Community Advisor

Then I believe your config.publish OSGI config is not working. Can you check on developer console if you see your OSGI config for publisher and is it the custom service on which you are calling the externalizer for publish?

Avatar

Level 3

@DPrakashRaj  In the Developer console able to see the config file, but its not picking config file changes also

Avatar

Community Advisor

Hello @bsr78033597 

 

1. Please validate the configs locally, to verify that the config file has no issues. Also, please remove the extra "" in externalizer.domains

 

2. Once we have the configs in, we also need to make sure, we use the right API

 

@Reference
Externalizer externalizer;
 
Externalizer externalizer = resourceResolver.adaptTo(Externalizer.class);
 
 
externalizer.publishLink(resolver, "/my/page") + ".html";
 
externalizer.authorLink(resolver, "/my/page") + ".html";

 

 


Aanchal Sikka

Avatar

Level 3

thanks @aanchal-sikka 
I set those environment variables through the command line local instance it's working fine.
But when we add those environments variables AEM cloud environment configuration, it's not picking values.