Spring profiles provide a way to separate parts of your application, including configuration, and make it only available in certain environments or when specific libraries are used.
You're recommended to set the label of your key-values to match your Spring profiles. By default, the App Configuration Spring provider library loads the key-values with the label(s) matching the current active Spring profile(s) (${spring.profiles.active}) if the label filter isn't set explicitly. If there's no active Spring profile set, key-values with "no label" will be loaded.
For example, with profiles dev and prod, you create key-values accordingly with the following labels.
KeyLabelValue /application/config.messagedevHello from dev /application/config.messageprodHello from prod
When the Spring profile is set to dev, the value of config.message will be Hello from dev. When the Spring profile is set to prod, the value of config.message will be Hello from prod.
This default behavior can be overridden by setting the label filter in your bootstrap file. The Spring provider library loads key-values with the specified label(s) regardless of the active Spring profile.
spring.cloud.azure.appconfiguration.stores[0].selects[0].label-filter: my-label
To select other labels and your Spring profile(s), you can use a label filter like ',${spring.profiles.active}', which will select all keys without a label and the ones matching your Spring profiles. The rightmost label(s) take priority when duplicate keys are found.