skip to Main Content

I am trying to configure some key/value pairs for my Azure web application using app settings section from Azure portal to my Spring boot java class. I have Spring boot project, now i want to fetch some static URL and other config values from the Aure web app that my Spring boot project hosted. How to get that?

For example as below. I have added activeDirectotyEnabled key and value as true in Azure portal.

enter image description here

I want to fetch the value of the name ‘activeDirectotyEnabled’ in my java class.

Please help how to get that?

2

Answers


  1. If I am understanding your scenario correctly, You can connect your Spring Boot app to an App Configuration store and can externalize configuration properties to Azure App Configuration.

    See this detailed tutorial: Quickstart: Create a Java Spring app with Azure App Configuration

    Login or Signup to reply.
  2. As the description in the picture

    Application Settings are exposed as environment variables for access by your application at runtime.

    So these are just environment variables, you can read them as any other environment var in Spring Boot

    for example

    @Value("${activeDirectotyEnabled}")
    boolean isActiveDirectotyEnabled;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search