AppConfiguration icon indicating copy to clipboard operation
AppConfiguration copied to clipboard

Manage all App Configuration data in one file

Open realbart opened this issue 4 years ago • 7 comments

I would very much like to be able to create/update app configuration values, with different labels and also keyvault references in one step. At this moment I'm forced to make a separate file AND pipeline step for every label/contenttype-combination.

I would expect the config file to look a bit like this:

[
  {
    "label": "My.Label"
    "key": "MySetting:Foo",
    "value": "FooValue",
  },
  {
    "key": "ConnectionStrings:Bar",
    "value": "https://tdm-bar.azure.net/secrets/Bar/",
    "contenttype": "application/vnd.microsoft.appconfig.keyvault"
  }
]

Our company policy says all application code and configuration must originate from either source control or the release pipeline (which we are also putting in source control). In other words: no setting is to be done manually and no setting can be done without review by someone else.

realbart avatar Sep 16 '21 04:09 realbart

@realbart, great feedback. The design of the current file import/export is to enable users to consume those config files in their applications without any code change. What you bring up is a bit different scenario where you need to use files for configuration authoring. It's absolutely a reasonable scenario to me. We will look into it.

zhenlan avatar Sep 16 '21 15:09 zhenlan

We add the capability in Azure CLI so you can manage your App Configuration key-values with different labels, tags, content-types all in one JSON file. Please give it a try and share any feedback with us. If it works well, we will add the capability in other tools, such as Azure pipeline tasks, GitHub actions, portal, etc.

You will need to download Azure CLI version 2.30.0 or later. Then use parameter --profile appconfig/kvset when importing from or exporting to a file. For example,

az appconfig kv export -n <store_name> -d file --path <file_path> --format json --profile appconfig/kvset --label * 
az appconfig kv import -n <store_name> -s file --path <file_path> --format json --profile appconfig/kvset

zhenlan avatar Nov 09 '21 21:11 zhenlan

Nice!

I just tried it on CloudShell and it does exactly what I need. I’ll try and integrate it into our pipeline tomorrow, initially just with an Azure CLI Taskhttps://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-cli?view=azure-devops.

This makes things a lot easier for us. Thanks!

Bart Kemps

From: Zhenlan Wang @.> Sent: Tuesday, November 9, 2021 10:59 PM To: Azure/AppConfiguration @.> Cc: Bart @.>; Mention @.> Subject: Re: [Azure/AppConfiguration] Making the release pipeline leading for appsettings is pretty cumbersome (#552)

We add the capability in Azure CLI so you can manage your App Configuration key-values with different labels, tags, content-types all in one JSON file. Please give it a try and share any feedback with us. If it works well, we will add the capability in other tools, such as Azure pipeline tasks, GitHub actions, portal, etc.

You will need to download Azure CLIhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fcli%2Fazure%2Finstall-azure-cli&data=04%7C01%7C%7C83086065605447a5e52608d9a3cc2a5c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637720919550951838%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8bJr51R19%2FL3dEA0mb5ebpWG6kWFPKjAjVUaF0pkp%2BI%3D&reserved=0 version 2.30.0 or later. Then use parameter --profile appconfig/kvset when importing from or exporting to a file. For example,

az appconfig kv export -n <store_name> -d file --path <file_path> --format json --profile appconfig/kvset

az appconfig kv import -n <store_name> -s file --path <file_path> --format json --profile appconfig/kvset

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2FAppConfiguration%2Fissues%2F552%23issuecomment-964584196&data=04%7C01%7C%7C83086065605447a5e52608d9a3cc2a5c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637720919550961828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=t4FPsHbPfHcI9VeidpGfJsLSyvfD9CWIRcEB01psooU%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABZXLZOYLP7ZNC7JOCNZRBLULGKTBANCNFSM5ED3VTYA&data=04%7C01%7C%7C83086065605447a5e52608d9a3cc2a5c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637720919550961828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9dFpaOUNKOTk3QO1bBAF6rYHTFInsxwtUZdWvztG4NE%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7C83086065605447a5e52608d9a3cc2a5c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637720919550971822%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xn4phx11f2Tje%2B6tIVoZf1wI6oZg1EfmOQABXwneCIE%3D&reserved=0 or Androidhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7C83086065605447a5e52608d9a3cc2a5c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637720919550971822%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=p6%2FwEELdNako9s02r%2BvCuV52xlLSS%2BSu%2FS4BZ4cwbg4%3D&reserved=0.

realbart avatar Nov 09 '21 22:11 realbart

We add the capability in Azure CLI so you can manage your App Configuration key-values with different labels, tags, content-types all in one JSON file. Please give it a try and share any feedback with us. If it works well, we will add the capability in other tools, such as Azure pipeline tasks, GitHub actions, portal, etc.

You will need to download Azure CLI version 2.30.0 or later. Then use parameter --profile appconfig/kvset when importing from or exporting to a file. For example,

az appconfig kv export -n <store_name> -d file --path <file_path> --format json --profile appconfig/kvset
az appconfig kv import -n <store_name> -s file --path <file_path> --format json --profile appconfig/kvset

It seems that this does not allow to export to a file for all labels in a single shot. I am only able to export a single label at a time. Reading the documentation for flag --label, it says:

Only keys and feature flags with this label will be exported. If no label specified, export keys and feature flags with null label by default. Only when export destination is appconfig, we support star sign as filters, for instance * means all labels and abc* means labels with abc as prefix. Label filters are not supported when exporting to file or appservice.

Could this be the case when exporting to a file also?

HugoSousa avatar Apr 14 '22 13:04 HugoSousa

@HugoSousa give it a try with --label *. It should export all labels at once. We realized we missed updating the help message you mentioned above. It will be updated in the next CLI release. I also updated my message above inline.

zhenlan avatar Apr 14 '22 14:04 zhenlan

We have an official document on this topic out now https://docs.microsoft.com/azure/azure-app-configuration/concept-config-file

zhenlan avatar Apr 15 '22 18:04 zhenlan

A new release is out Azure App configuration Push task version 3.3.0 allows you to manage your App Configuration key-values with different labels, tags, content-types all in one JSON file. Please give it a try and share feedback with us. You will need to specify the FileContentProfile as appconfig/kvset. Check out the schema

MaryanneNjeri avatar Jul 14 '22 06:07 MaryanneNjeri

This enhancement has been added.

jimmyca15 avatar Jul 31 '23 17:07 jimmyca15