I am working on updating Azure DevOps library using the REST API.
Need suggestion on how I can update a single variable in Azure DevOps library without re-sending all variable details using the REST API, considering that I have sensitive content saved in certain library variables?
The end point which I currently use -
PUT https://dev.azure.com/{organization}/_apis/distributedtask/variablegroups/{groupId}?api-version=7.1-preview.2
However, I have to get details from Azure Library and re-send all the variable details again and again, even though I need to update a single entry.
When you use Rest API to update the variable in Variable Group, you need to send all variable details in the request body. This is required.
I checked how it is done on Azure DevOps UI and there is used the same PUT endpoint as you mentioned.
However, when you update there single value they still send all variables:
For example:
I am afraid that there is no such method can only update one variable without resending All Variable Details when using Rest API.
For a workaround, you can change to use Azure DevOps CLI to update the variable in variable group: az pipelines variable-group variable update
The Azure DevOps CLI supports only updating one variable without resending All Variable Details.
For example:
Here is the doc about how to use Azure DevOps CLI