Question: Spring Cloud Config Server accepts multiple profile and returns the properties for all the profiles when I access the /env endpoint of the application. The response lists the properties specific to each profile. If same property is present in 2 different property files , the one that is defined last takes precedence. Is there a way to get the final list of property key and values that will be used by the application?

Answer: 
```
import java.util.properties;

import org.springframework.core.env.AbstractEnvironment;
import org.springframework.core.env.CompositePropertySource;
import org.springframework.core.env.Environment;

public class MyClass {
  @Autowired
  private Environment    env;

  Properties getProperties() {
    Properties props = new Properties();
    CompositePropertySource bootstrapProperties = (CompositePropertySource)  ((AbstractEnvironment) env).getPropertySources().get("bootstrapProperties");
    for (String propertyName : bootstrapProperties.getPropertyNames()) {
      props.put(propertyName, bootstrapProperties.getProperty(propertyName));
    }

    return props;
  }

}

```

Sorry... this is my first time answering a question here. I created an account specifically to
answer this question because I came upon it while researching the same issue. I found a 
solution that worked for me and decided to share it.

Here goes my explanation of what was done:

1. I initialize a new "Properties" object (could be a HashMap or whatever else you want)
2. I lookup the property source for the "bootstrapProperties" which is a CompositePropertySource object.
This property source contains all of the application properties that were loaded.
3. I loop through all the property names returned from the "getPropertyNames" method on the CompositePropertySource object
and create a new property entry.
4. I return the properties object.
This seems to be an intentional limitation of the Spring Framework.

See [here](https://jira.spring.io/browse/SPR-10241 "here")

You could hack it and inject the PropertySources interface, then loop over all the individual PropertySource objects, but you'd have to know what properties you're looking for.