Search code examples
spring-bootazureproduction-environment

How do I use access.properties variables in an Azure Spring Boot deployed app?


I have an Azure App Service, that's running my Spring Boot App, but in certain classes, I use the @Value("${}") annotation, to access variables from access.properties file. But it seems not to be working in the deployed app (production).


Solution

  • [Answering my question]

    As it looks like, I can simply put the application.properties variables in Setting > Configuration > Application Settings tab, adding as a name:value pairs

    Then Spring already finds the values with the @Value("${name}") annotation

    twitter API configs

    BONUS: The application.properties file, should be like this, if you are using Git CI/CD

    enter image description here