Reputation: 912
I am using azure app configurations to store my feature flags. By default feature flags are loaded as per the current profile, set in application.yaml like:
spring.profile.active
Now, my deployment environments has seperate instances of azure app config for dev, pre and prod.
So, I want if my application is running on dev environment then it should be able to load both No Label and dev label. Like if some one has defined keys only with No label then it should also work and should be able to fetch value.
This can be worked with app config by providing:
spring.cloud.azure.appconfiguration.stores[0].selects[0].label-filter: ",${spring.profiles.active}"
but providing same with feature flags doesn't work:
spring.cloud.azure.appconfiguration.stores[0].feature-flags.label-filter:",${spring.profiles.active}"
Can any suggest the way to load No Label flag when spring.profile.active has some value.
Upvotes: 0
Views: 442
Reputation: 912
This can be achieved by setting:
spring.cloud.azure.appconfiguration.stores[0].feature-flags.selects[0].label-filter = ",${spring.profiles.active}"
Upvotes: 0
Reputation: 493
What version of your library are you using, that configuration setup looks like an old one. If you updated to the latest:
For Spring Framework 2
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-appconfiguration-config</artifactId>
<version>4.8.0</version>
</dependency>
For Spring Framework 3
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-appconfiguration-config</artifactId>
<version>5.2.0</version>
</dependency>
The latest versions support the same loading style for feature flags as configurations, see the last table here https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/spring-cloud-azure-starter-appconfiguration-config#supported-properties
Upvotes: 1