Azure App配置:labelFilter:是否可以“偏爱”某个标签而不排除其他标签?

问题描述 投票:0回答:1

在Azure应用程序配置中,您可以存储具有多个值的键,并以标签来区分。

构建配置时,可以使用labelFilter =“ SomeLabel”过滤从商店中读取哪些密钥。

在我的情况下,我在应用商店中有50个没有任何标签的键[[(没有标签)] >>和4个键,它们具有两个值,一个值用于标签SomeLabel

,另一个值用于(标签)。 我想检索所有54个键。对于具有多个值的4个键,我想要带有标签

SomeLabel

的值。如果我使用

labelFilter =“ SomeLabel”

我只得到带有标签的4个键,则过滤掉没有任何标签的50个键。是否可以实现我想要的功能?

<configBuilders> <builders> <add name="SomeAzureAppConfigStore" labelFilter="SomeLabel" mode="Greedy" prefix="My.App:" stripPrefix="true" connectionString="${MyConnectionString}" useAzureKeyVault="true" type="Microsoft.Configuration.ConfigurationBuilders.AzureAppConfigurationBuilder, Microsoft.Configuration.ConfigurationBuilders.AzureAppConfiguration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxx" /> </builders> </configBuilders>

在Azure App配置中,您可以存储具有多个值的键,这些值由标签区分。构建配置时,可以通过使用labelFilter = ...
azure asp.net-core-2.1 azure-app-configuration
1个回答
0
投票
您的问题的解决方案是使用多个标签。如果将“%00”设置为标签之一,则将其视为空标签。然后,它将加载两组标签,并且根据它们设置的顺序,将导致使用其他4个标签而不是非标签版本。
© www.soinside.com 2019 - 2024. All rights reserved.