Refresh Not working with Azure App Configuration Spring Boot 2.6.6

55 views Asked by At

Hi I am facing an issue with the configuration update from Azure app Configuration while I am integrating it with my spring webflux project with the following configuration. I am sucessfully able to fetch it wile the start of the application but not able to get the update on the configuration.

Reference documentation: https://microsoft.github.io/spring-cloud-azure/docs/azure-app-configuration/2.5.0/reference/html/index.html#configuration-refresh

Java version : 11 Spring boot version: 2.6.6 azure-keyvault-secrets-spring-boot-starter: 2.3.2

My approach while integrating App Configuration with spring Webflux project.

pom.xml

   <dependency>
      <groupId>com.azure.spring</groupId>
      <artifactId>azure-spring-cloud-starter-appconfiguration-config</artifactId>
      <version>2.10.0</version>
     </dependency>
    
    <!-- https://mvnrepository.com/artifact/com.azure.spring/azure-spring-cloud-appconfiguration-        config-web -->
    <dependency>
      <groupId>com.azure.spring</groupId>
      <artifactId>azure-spring-cloud-appconfiguration-config-web</artifactId>
      <version>2.11.0</version>
    </dependency>

bootstrap.properties

spring.cloud.azure.appconfiguration.stores[0].connection-string=Endpoint=......
    spring.cloud.azure.appconfiguration.name=my-appname
    spring.cloud.azure.appconfiguration.stores[0].selects[0].key-filter=my-app-name
    spring.cloud.azure.appconfiguration.stores[0].monitoring.triggers[0].key=sentinal
    spring.cloud.azure.appconfiguration.stores[0].monitoring.triggers[0].label=stage
    
    spring.cloud.azure.appconfiguration.stores[0].monitoring.push-notification.primary-token.name=my-token
    spring.cloud.azure.appconfiguration.stores[0].monitoring.push-notification.primary-token.secret=my-secret
    
    spring.cloud.azure.appconfiguration.refresh-interval=10s
    
    spring.cloud.azure.feature.management.fail-fast=false

My AppConfiguration File

 import lombok.AllArgsConstructor;
    import lombok.Data;
    import lombok.NoArgsConstructor;
    import org.springframework.beans.factory.annotation.Value;
    import org.springframework.boot.context.properties.ConfigurationProperties;
    import org.springframework.cloud.context.config.annotation.RefreshScope;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.stereotype.Component;
    
    
    @Configuration
    @Data
    @ConfigurationProperties("config")
    @RefreshScope
    public class MyAzureAppConfig {
      private String message;
    
      private int coolOffPeriod;
    }

I have ensured that the trigger key do exist and the token and the secret matches to that from the azure app configuraiton. However I am not able to fetch the updated configuration value from the azure app config everytime the value changes.

Can someone please help me on what I am missing here?

I expect my application to receive change in the configuratoin without restarting the application.

0

There are 0 answers