Mike
Mike

Reputation: 37

Azure App Configuration LabelFilters in .Net 4.8 Not working Correctly

I have several App Configuration Keys that are working correctly. Now one of them I need to have based on Environment so I am trying to use labels. So I have 2 labels "Production" and "ProductionIntranet".

labelFiler=""

This brings back all the keys without labels.

According to the documentation this should bring back all null and ProductionIntranet

labelFilter="%00,ProductionIntranet"

This does not get any of the keys (Not the ones with labels or the null ones)

labelFilter="%00"

Neither does this.

I am sure this is a simple syntax issue but I am racking my head and I cannot figure it out. Any help would be greatly appreciated.

Upvotes: 1

Views: 446

Answers (1)

Mike
Mike

Reputation: 37

I got it to work. I am not sure it is the best solution but it works. I created 2 buulder stores and had the first with no labelFilter (AppSettingsStore) which gave me all the keys without any labels and then I created a second that had ProductionIntranet as a filter(AppSettingsStoreIntraNet).

Then I updated appsettings like this

<appSettings configBuilders="Environment,AppSettingsStore,AppSettingsStoreIntraNet">

This might be making two calls to App Configuration. If someone knows how to do this in one ConfigBuilder please let me know.

Upvotes: 1

Related Questions