Following my previous article about how to update a variable group using POSTMAN, I will now document how to implement the same behavior through a pipeline.
First things first you will need a PAT. I have included this PAT in a different variable group than the one that I will update. this is because when you update the variable group, all the variables that are inside will get lost. If you need to retain them, you should have to get them first and then add them again on the variable group.
For this reason I have created a variable group named token-group which holds my PAT. I also made this variable a secret.
The variable group that I will update has the name of var-group and the id of 5.
The pipeline includes two tasks. The first task will loop through the variables on the group and print them out. The second task will update the variable group based on the JSON that you provided. You should change your ORG and project URLs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters