Spring Cloud Services v1.0

The Config Server

Page last updated:

The Config Server serves configurations stored as either Java Properties files or YAML files. It reads files from a Git repository (a configuration source). Given the URI of a configuration source, the server will clone the repository and make its configurations available to client applications in JSON as a series of propertySources.

Note: Config Server for Pivotal Cloud Foundry® does not support multiple repositories as configuration sources at this time.

Configuration Sources

A configuration source contains one or more configuration files used by one or more applications. Each file applies to an application and can optionally apply to a specific profile and / or label.

The following is the structure of a Git repository which could be used as a configuration source.

|- myapp.yml
|- myapp-development.yml
|- myapp-production.yml

tag v1.0.0
|- myapp.yml
|- myapp-development.yml
|- myapp-production.yml

In this example, the configuration source defines configurations for the myapp application. The Server will serve different properties for myapp depending on the values of {profile} and {label} in the request path. If the {profile} is neither development nor production, the server will return the properties in myapp.yml, or if the {profile} is production, the server will return the properties in both myapp-production.yml and myapp.yml.

{label} can be a Git commit hash as well as a tag or branch name. If the request contains a {label} of (e.g.) v1.0.0, the Server will serve properties from the v1.0.0 tag. If the request does not contain a {label}, the Server will serve properties from the default label. For Git repositories, the default label is master. You can reconfigure the default label (see the Creating an Instance subtopic).

Request Paths

Configuration requests use one of the following path formats:


A path includes an application, a profile, and optionally a label.

  • Application: The name of the application. In a Spring application, this will be derived from or

  • Profile: The name of a profile, or a comma-separated list of profile names. The Config Server’s concept of a “profile” corresponds directly to that of the Spring Profile.

  • Label: The name of a version marker in the configuration source (the repository). This might be a branch name, a tag name, or a Git commit hash.

For information about using a Cloud Foundry application as a Config Server client, see the Configuration Clients subtopic.

Create a pull request or raise an issue on the source for this page in GitHub