Using Configurations from Configuration Management Services

You can use configurations from the configuration management services such a ZUUL or Spring Cloud Config by defining a token such as #<property name># in the application properties, where <property name> is the name of the configuration parameter.

For example, #RESPONSE_MESSAGE#.

The environment variable APP_CONFIG_PROFILE can be used to identify the profile name for your deployment environment, for example QA or Prod. For more information, see Environment Variables for Cloud Foundry.

Integrating with Spring Cloud Config Server

Support for application configuration is provided through integration with the Spring Cloud Config Server.

You first create an instance of the service using the Pivotal Platform Apps Manager and then bind this service instance to your application.

Note: TIBCO BusinessWorks Container Edition communicates with Spring Cloud® Services using HTTPS. If your Cloud Foundry installation uses a self-signed SSL certificate, this certificate should be added to the buildpack before your application can be deployed. To add self-signed SSL certificate to the buildpack, see the Certificate Management section of Customize the Buildpack.

Using Custom User Provided Services (CUPS) for Config Servers

The following are required when integrate your application with custom user provided services (CUPS) Spring Cloud Config or ZUUL Configuration service in Cloud Foundry:

  1. Name of the Cloud Foundry service instance must contain either spring-cloud-config or zuul-config.
  2. The service configuration must contain the uri parameter.

    For example, for ZUUL

    {
       "credentials": { 
           "uri": "http://{ZUUL-SERVER-IP}:{PORT}/zuul" 
         }, 
      "label":"user-provided",
      "name": "zuul-config-server", 
      "syslog_drain_url": "", 
      "tags": [] 
    }
    
    For Spring Cloud
    {
       "credentials": { 
           "uri": "http://{SPRING-CLOUD-SERVER-IP}:{PORT}" 
         }, 
      "label":"user-provided",
      "name": "spring-cloud-config-server", 
      "syslog_drain_url": "", 
      "tags": [] 
    }

The environment variable APP_CONFIG_PROFILE can be used to set ProfileName. If this variable is not set, default name is used for the profile.

The environment variable SPRING_CLOUD_CONFIG_VAULT_TOKEN can be used to pass the Vault token for Pivotal Platform application, while using Vault as back end for Spring Cloud Config.

Note: Using the methods from the new ProfileResolverHelper class, users can write their own integration for config management servers
  • getKeysForConfig()- This method returns the list of all the tokens that are required to fetch from the config management server.
  • replaceProfileValues()- This method replaces values of the corresponding keys, fetched from the users, in the pcf.substvar file.