azure - 如何在Azure应用程序配置中添加 map

标签 azure azure-app-configuration

在Azure应用程序配置中,我们以键值对的形式存储值。通常,我们将字符串值存储在键值对中,例如:

    "key" : "red"

但我想将 map 存储为如下值:

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

在我的 spring-boot 应用程序中,我会将变量读取为 Map

最佳答案

您可以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"}}}

关于azure - 如何在Azure应用程序配置中添加 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69725478/

相关文章:

windows - Windows Azure 能否随着负载变化动态扩展应用程序?

java - Spring Boot 和 Azure : initialise bean before auto-configuration

azure - 升级 Azure VM 会毁掉 VM 吗?

regex - 为 Verizon 中的 Azure CDN 创建重定向规则,将/index.html 添加到 URL 末尾

c# - Azure 应用程序配置未加载 key

azure-app-configuration - 使用托管标识连接到 Azure 应用配置时出现 403

azure - 在 Terraform Azure azurerm 中,如何获取应用程序配置连接字符串?

azure - 如何限制从 Spring Boot 应用程序向 Azure 应用程序配置发出的请求数量?

c# - 如何将Azure Function日志发送到blob存储?

azure - trace.writeline 在 azure Onstop 方法中不起作用