Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
632 stars 242 forks source link

[Feature Request] az pipeline variable-group importing #941

Open BUR70N opened 4 years ago

BUR70N commented 4 years ago

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

geverghe commented 4 years ago

@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?

BUR70N commented 4 years ago

@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.

mohamednasr commented 3 years ago

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

foliveiraGH commented 3 years ago

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

ronwarner commented 3 years ago

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.

argelj289 commented 2 years ago

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?

stevecrisci2 commented 1 year ago

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.

kemmis commented 6 months ago

+1 for export/import variable groups easier

rafaelcaviquioli commented 6 months ago

+1 for export/import variable groups easier