-1

Looking for 2 solutions

  • How to identify the list of pipelines attached with a variable group in AzureDevops say from the variable group name, i want to understand what are the pipelines (both build and release) pipelines refering the values from that VG.

  • How to create a secrete variable in the VG using the az command, while creating the VG itself

    az pipelines variable-group create --name <variable_group_name} --variables myvalue=$myvalue

here its creating normal variable, but I want to create secrete variable in the same coomand above while creating the VG itself.

Adding the Details as mentioned in the comments

So here the problem i am facing is

in my curret bash script, we are using the below commands to create variable group and variable together.

az pipelines variable-group create --project=myproject --name $variable_group_name --authorize true --variables mynKey=$my_key

So if I want to split this to commands, not sure how I can obtain the group id for the created variable group.

az pipelines variable-group create  --project=$projectname --name $variable_group_name --authorize true

az pipelines variable-group variable create --group-id <?????> --name myKey --project=$projectname --secret  true --value $my_key
Vowneee
  • 956
  • 10
  • 33

1 Answers1

0

i want to understand what are the pipelines (both build and release) pipelines refering the values from that VG.

We could only list the pipelines which refering variable group based on check the pipeline one by one with the REST API Definitions - Get. But we could not check the pipeline list based on the variable group.

Details:

  • Use the RETS API Definitions - List to list all the pipelines, then we could get all the definitionIds.

  • Loop use the REST API Definitions - Get to get the details info about the pipeline.

    enter image description here

How to create a secrete variable in the VG using the az command, while creating the VG itself

You could use the az command az pipelines variable-group create to create a blank variable group at first.

Then use the another az command az pipelines variable-group variable create to add the variable with the option --secret {false, true}:

az pipelines variable-group variable create --group-id
                                            --name
                                            [--org]
                                            [--project]
                                            [--secret {false, true}]
                                            [--subscription]
                                            [--value]
Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • But How we will get the Variable group id here? – Vowneee Sep 06 '21 at 12:10
  • Currently using this command in my basch script .. there its creating variable group and variable with value directly. "az pipelines variable-group create --project=$projectname --name $variablegroupname --authorize true --variables myKey=$my_key" – Vowneee Sep 06 '21 at 12:24
  • added the details to my question part – Vowneee Sep 06 '21 at 17:47