0

In the Azure App Configuration, we store value in the form of key-value pair. Generally, we store string values in the key-value pair like:

    "key" : "red"

But I want to store map in value like:

    "key" : {
               1: {1,2,3},
               2: {1,4}
             }

In my spring-boot application, I will read the variable as Map<integer, List>

1 Answer 1

2

You can Leverage content-type to store JSON key-values in App Configuration.

Data is stored in App Configuration as key-values, where values are treated as the string type by default. However, you can specify a custom type by leveraging the content-type property associated with each key-value, so that you can preserve the original type of your data or have your application behave differently based on content-type.

Valid JSON values

When a key-value has JSON content-type, its value must be in valid JSON format for clients to process it correctly. Otherwise, clients may fail or fall back and treat it as string format. Some examples of valid JSON values are:

  • "John Doe"
  • 723
  • false
  • null
  • "2020-01-01T12:34:56.789Z"
  • [1, 2, 3, 4]
  • {"ObjectSetting":{"Targeting":{"Default":true,"Level":"Information"}}}
Sign up to request clarification or add additional context in comments.

1 Comment

In the spring-boot application, I am getting this error when I received the value: Description: Failed to bind properties under 'config.cold-chain-compliance-map' to java.util.Map<java.lang.String, java.util.Map<java.lang.Integer, java.util.List<java.lang.Integer>>>: Reason: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, java.util.Map<java.lang.Integer, java.util.List<java.lang.Integer>>>] Action: Update your application's configuration

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.