Force stop Azure App Config use spring active profiles as label

71 views Asked by At

I have a working spring boot application that loads properties from Azure AppConfig service

Here is a bootstrap.yml:

spring:
  cloud:
    azure:
      appconfiguration:
        stores[0]:
          feature-flags:
            enabled: true
          selects[0]:
            key-filter: ${key-filter}
          connection-string: ${connection-string}

It's all working just fine BUT If any spring profile is active, Azure AppConfig uses it as a label filter, it's event says in their doc: https://learn.microsoft.com/en-us/java/api/overview/azure/spring-cloud-starter-appconfiguration-config-readme?view=azure-java-stable

And also the profile being added to the BootstrapPropertySource you could find in logs when you run the app:

without profile: BootstrapPropertySource {name='bootstrapProperties-${key-filter}/${your_link}/ '}

with profile: BootstrapPropertySource {name='bootstrapProperties-${key-filter}/${your_link}/profile'}

and in case with profile enabled, properties are not being loaded I tried option with adding 'label-filter: ,' but it does not work

Maybe there is any way to force AppConfig NOT use the spring profile at all?

1

There are 1 answers

0
mrm9084 On

You you set the label filter but don't give it a value it will load all configuration settings without a label. For more info see https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/app-configuration-support?tabs=azure-ad#selecting-configurations