I am trying to update a variable group from an Azure DevOps Pipeline. This is the API documentation from Microsoft. I am calling this API via Postman with HTTP PUT and a Header Authorization Basic {PAT}. The URL is https://dev.azure.com/{organization}/_apis/distributedtask/variablegroups/{groupId}?api-version=6.0-preview.2 Regardless of the JSON body it always returns:
{
"$id": "1",
"innerException": null,
"message": "Project information name is not valid for variable group.",
"typeName": "System.ArgumentException, mscorlib",
"typeKey": "ArgumentException",
"errorCode": 0,
"eventId": 0
}
Sample JSON Bodies:
Test 1
{
"type": "Vsts",
"name":"JobStatus"
}
Test 2
{
"variables": {
"rest-var1": {
"isSecret": false,
"value": "rest-var-value-1"
},
"rest-var2": {
"isSecret": false,
"value": "rest-var-value-2"
},
"rest-var3": {
"isSecret": false,
"value": "rest-var-value-3"
}
},
"name":"JobStatus"
}
If I call this same API with HTTP GET it returns all of the details of the group. This was reported as a bug to Microsoft but the page didn't provide any details as to the solution.