APP config exporting key value pairs limitaion

Bodavula Sai Vamsi Mohan Krishna 20 Reputation points
2023-08-30T05:50:33.34+00:00

Hey Team.
Basically, I am working on exporting Key value pairs from my appconfig on azure .
so this is my command I have been implementing to export .
az appconfig kv export -n myappconfig-list1-demo -d file --path ./test123.yaml --prefix "/a/lab1234/" --separator "." --key "/a/lab1234/configmap.app.name","/a/lab1234/configmap.server.port","/a/lab1234/configmap.highq.multitenant.datasource.connections.default.url","/a/lab1234/deployment.hostname","/a/lab1234/deployment.istioGateway","/a/lab1234/configmap.server.servlet.context-path","/a/lab1234/configmap.hub.url" --format yaml -y --resolve-keyvault

Instead of exporting all the key value pairs in the concerned list, I am just exporting which ever required for my current task, and i am mentioning multiple keys pairs in --key separated by comma (,).

So my concern here is , I am able to export them correctly with 5 keypairs, if i add one more to the list , its failing with the error : Operation returned an invalid status 'Bad Request'

Is there is any limit to the key pairs values while exporting using az appconfig kv export process.
I havnt find any supporting document for this regarding this., so i would appreciate response in this concern.

Thanks in advance.

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
237 questions
0 comments No comments
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,341 Reputation points
    2023-08-30T13:29:26.14+00:00

    Bodavula Sai Vamsi Mohan Krishna Thanks for posting your question in Microsoft Q&A. Currently, the name filtering for keys is limited to 5 comma-separated values (CSV), and it is documented in Filtering Rest API doc. CLI command az appconfig kv export uses this rest api and hence the same limitation applies. You can consider using * to match any prefix or running repeatedly as suggested by Deepanshu katara.

    I will pass the feedback to our doc team for adding this note, however, you can also submit it via Feedback at the bottom of the page (az-appconfig-kv-export doc). I hope this helps and let us know if any questions.


    If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Deepanshukatara-6769 10,455 Reputation points
    2023-08-30T06:55:56.95+00:00

    Hope you are having good day

    Indeed, command-line arguments do have a length limit, and that might be a potential reason for the "Bad Request" error you're encountering. When you provide a long list of keys as arguments to a command, the total length of those arguments might exceed the operating system's command-line length limit.

    To address this issue, you can try the following approaches:

    1. Split into Multiple Commands: Instead of providing all the keys in a single command, you can split them into multiple commands, each exporting a subset of the keys. This way, you avoid hitting the command-line length limit.
    bashCopy code
    az appconfig kv export -n myappconfig-list1-demo ... --key "key1","key2","key3" -y --resolve-keyvault
    az appconfig kv export -n myappconfig-list1-demo ... --key 
    "key4","key5","key6" -y --resolve-keyvault
    
    
    

    Adding to this The idea I mentioned about splitting into multiple commands is a manual approach you can take to avoid command-line length limits. It involves running the same az appconfig kv export command multiple times, each time specifying a subset of the key-value pairs to export. This approach doesn't have an official Microsoft documentation page because it's not a standardized feature or option of Azure CLI.

    if it helps you please accept answer , Thanks


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.