OSGi configuration immutability and alternatives in AEM as a Cloud Service

In managed AEM as a Cloud Service environments, OSGi configuration changes are deployed through the project and Cloud Manager pipeline rather than saved as persistent production changes in the Web Console. For settings that authorized users must change independently of a code release, design the application to read validated, permission-controlled configuration content. To choose the right approach, distinguish deployment configuration, environment-specific values, secrets, and user-managed operational settings.

Description description

Environment

Adobe Experience Manager as a Cloud Service (all versions)

Symptoms

  • OSGi configurations are strictly immutable at runtime.
  • Configuration values cannot be updated through /system/console/configMgr as was possible in on-premise AEM 6.5.
  • Dynamic settings for custom Sling Servlets (such as form field mappings and target JCR paths) cannot be managed without a code deployment.
  • No runtime OSGi configuration changes are allowed.
  • Operational flexibility is reduced compared to on-premise deployments.
  • Configuration changes made via configMgr are not persisted.

Cause

AEM as a Cloud Service treats application code and OSGi configuration as immutable at runtime for security and stability. Operational flexibility is achieved by using repository-managed content and Cloud Manager environment variables instead of runtime OSGi configuration changes.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Store the OSGi configuration files in the project’s Git repository to maintain version control.
  2. Deploy the OSGi configuration changes through Cloud Manager.
  3. For environment-specific values, reference Cloud Manager environment variables and secrets in the OSGi configuration by using the $[ env:...] or $[ secret:...] syntax. Use this approach for endpoint URLs, credentials, and environment-specific flags.
  4. Model business and operational settings as repository-managed configuration or content. Store values such as form field mappings or target JCR paths under /conf or another controlled repository location.
  5. Use Sling Context-Aware Configuration or a custom configuration service to read the repository-managed values.
  6. Allow authorized users to manage the values through AEM configuration or content authoring. Apply appropriate permissions, validation, publishing controls, and auditing.
  7. For form field mappings, use Context-Aware Configuration, Content Fragments, or a custom structure under /conf.
  8. For target JCR paths, store the paths as editable configuration or content, validate them on the server, and restrict them to approved repository roots.
  9. For secrets or environment-specific endpoints, use Cloud Manager environment variables or secrets.
  10. Verify that each configuration value is managed through source control, Cloud Manager, or repository-managed content, as appropriate.
recommendation-more-help
experience-cloud-kcs-help-kbarticles