'Azure App Configuration export and import

I have a pretty simple line on code for import/export App Configuration between different envs.

az appconfig kv export -n appc1 -d file --path abc.json --format json --yes 
az appconfig kv import --name appc2 --source file --format json  --path abc.json --yes 

It works fine, if you need "the same". But, for example, in appc1 I have feature1 in enabled state, in appc2 feature2 - disabled. And when I importing - it's override feature1 (from disable to enable).

Is it possible somehow do not to change feature state if name the same?



Solution 1:[1]

Based on MICRSOFT DOCUMENTATION:

Exporting /Importing feature flags from app service is not supported with different configuration(e.g:-abc1-enabled & abc2-disabled).

One of the workaround you may try.

By disabling feature flag of abc1 import the same to abc 2 then enable feature in abc1.

enter image description here

enter image description here

Or by using CLI cmdlts you can enable or disabled feature flag of the particular app configuration.

Solution 2:[2]

I understand you are looking for an import functionality that will only create new items and not touch the items that already exist in your App Configuration store. This function doesn't exist today. If you use files to manage your data in App Configuration, the files will be considered the source of truth. If you want to enable or disable a feature flag, you should always use file import. So what you have in your App Configuration store is always consistent with what you have in the file.

This document has more discussions about managing configuration data in files https://docs.microsoft.com/en-us/azure/azure-app-configuration/concept-config-file

Solution 3:[3]

Have you tried using --profile appconfig/kvset ?

az appconfig kv import --profile appconfig/kvset --name your store name --source file --path appconfigdata.json --format json

if you want to touch just one feature flag and remain the others without changes, you can create one JSON file and add in the items section the feature flag that you would like to update or create. You can find the structure of the file in this link: https://docs.microsoft.com/en-us/azure/azure-app-configuration/concept-config-file#file-content-profile-kvset

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AjayKumarGhose-MT
Solution 2
Solution 3 Edgar Garcia