Ive got a YML file that creates a variable group and then another pipeline needs permission to said resource, it can be easily done manually via the UI in a very simple manner (picture).
Thing is i gotta do it programatically and i’m having a hard time going through azdevops’ documentation and figuring this out. The closest i got was from "devops/approvalsandchecks/pipeline-permissions" and "devops/distributedtask/variablegroups" but i have yet to be able to actually get this thing working.
Hope i made myself clear.
Thanks in advance!
nvm… got it to work. maybe its just me but i have hard times with az docs…
{
"pipelines": [
{
"id": 16,
"authorized": true
}
]
}
2
Answers
azureDevopsHearderGet.ps1
azureDevopsPipelineVariableGroupPermission.ps1
To authorizes a list of definitions for a given resource, we can use REST API Pipeline Permissions – Update Pipeline Permisions For Resource.
If you want to use the REST API but are not sure which one to use, the easiest way is to Collect the network trace in the browser of the manual operation on the UI. For authorizing the pipeline to access the resource group, you can clearly see the API and body used in the network trace.