azure-devops-cli-extension icon indicating copy to clipboard operation
azure-devops-cli-extension copied to clipboard

[Feature Request] az pipeline variable-group importing

Open BUR70N opened this issue 5 years ago • 9 comments

Issue

When exporting variable-groups via Devops cli using the following command - az pipelines variable-group show --group-id # -o yaml (Gets individual group variable) or if using this - az pipelines variable-group list -o yaml (Lists all the variable groups in one)

You end up with a long list of yaml code that you are unable to import, the same is if creating a new Variable Groups, this is more of an issue when moving DevOps accounts so doing an Export to then do a import. There appears to be no way to import this information.

Feature

When creating large ranges of names and values to a new or update Pipeline variable-group, rather than putting these in each time, could a yaml or json file be used to import the names and values, as doing this with out this you manually enter the cli each time.

With multiple variables being required would mean entering in them multiple times, when there is only a few lines to import this isn't so much of an issue but when a yaml/json file could be over 200 lines doing this manually each time could become laborious and time consuming, so could something like the following be added?

i.e. – az pipelines variable-group create -f c:\Azure\testyaml.yaml

BUR70N avatar Jan 22 '20 09:01 BUR70N

@BUR70N - Thank you for the feedback and for raising the issue here! This gives complete clarity on the scenario and the pain you are facing. Is this a common scenario for you? Multiple variable groups with say more than about 10 (my first assumption for a number beyond which manual entry may be a pain) variables per group?

geverghe avatar Jan 22 '20 09:01 geverghe

@geverghe - Glad that this has given clarity on what I think could add value. This could be a common scenario going forward when working for clients. Yes indeed more than 10 or even more than 5 could start to be a pain when doing manually also when you have multiple groups to do can be a pain, so doing it all in one go via a file could really save time.

BUR70N avatar Jan 22 '20 09:01 BUR70N

I was just asking about a feature like this, it will be more efficient if I can import my json file directly to be in a variable group and I can edit on it directly, if there is any way to make something like that please can you share with us. it takes long work to convert my json file into a variable group also I have to duplicate the work for each stage with different variables

mohamednasr avatar Jan 12 '21 08:01 mohamednasr

I would like to be able to import too, I was researching about it, how to take variables to another project.

foliveiraGH avatar May 08 '21 00:05 foliveiraGH

I'm managing a lot of classic pipelines that use the same task groups with common variable names saved in them, and then I create a variable group for each pipeline where I define those variables, so all that must be done for a new application's pipeline is to associate it with the correct variable group. This is turning into dozens of variable groups. It would be extremely beneficial if I could create/update variable groups by importing a text file in JSON or some other simple structured format. If I'm reading this thread correctly, I think what's being requested might address my scenario.

ronwarner avatar Aug 10 '21 17:08 ronwarner

an import would be much helpful for us because we are exporting the variable groups to of course import it to another project for migration purpose. the first impression I had when I saw the export was there must be import also. and now learning that there is no import but just export. Where will we use the data we exported?

argelj289 avatar Jan 31 '22 11:01 argelj289

Is this the proper location for wishing for the ability to import variable groups as a feature? I was hoping that was still under consideration and possibly available soon, if not already.

stevecrisci2 avatar Nov 30 '22 16:11 stevecrisci2

+1 for export/import variable groups easier

kemmis avatar Apr 25 '24 12:04 kemmis

+1 for export/import variable groups easier

rafaelcaviquioli avatar Apr 26 '24 09:04 rafaelcaviquioli