Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

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 

 

12 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.


Avatar

Level 2

hi @naruk89179065 , did you find any solution to this? facing the same issue

Avatar

Community Advisor

I  am also  facing the same issue. The configurations given are not working as expected. It is only taking the URL of the server. Anyone else facing similar issue.

Avatar

Level 5

Follow the approaches below:

  1. Update Environment Variables in Cloud Manager:

    • To override publish and preview domains, adjust the AEM_CDN_DOMAIN_PUBLISH and AEM_CDN_DOMAIN_PREVIEW environment variables directly in Cloud Manager.
  2. Use Custom Environment Variables:

    • Define custom variables (e.g., CUSTOM_EXTERNALIZER_PUBLISH) instead of using the reserved AEM_EXTERNALIZER_PUBLISH.

Note: The second option also works fine when I tried but may cause unpredictable application behavior according to the Adobe Experience Manager documentation,
I have not faced any issues so far.