有没有办法使用 REST API 将变量组名称传递给发布管道,而无需编辑发布定义。
我可以使用以下方法来做到这一点
$defurl = "https://vsrm.dev.azure.com/org/proj/_apis/release/definitions/13?api-version=5.1"
$def = Invoke-RestMethod -Uri $defurl -Method Get -Headers $header
$def.variableGroups="VariableGroupName"
$json = @($def) | ConvertTo-Json -Depth 99
$udef = Invoke-RestMethod -Uri $defurl -Method Put -Body $json -ContentType "application/json" -Headers $header
但问题是“ Put ”请求更新原始定义。有没有办法在不编辑发布定义的情况下传递变量组。这是动态编辑发布定义以传递变量组的好习惯吗?