We are using AzureDevops server and automated our pipeline variable group and variables creation using a pre-build task which will run bash script below and will gerate the variabel and Variable group together
Since its a sensitive information, we would need to hide this variables value, so came across the article about the secret vraiable.. But its identified that we cant use the same az command which we were using the VG and variables together for the secret variable creation and would need to call the existing created VG by its group id and need to pass the secret value as a second step.
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