I am trying to update release scoped variables for the existing release using API.
Issue: receiving exception on API call (PUT https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}?api-version=5.1-preview.8)
Invoke-RestMethod : {"$id":"1","innerException":null,"message":"You are using an old copy of release. Refresh your copy and try
again.","typeName":"Microsoft.VisualStudio.Services.ReleaseManagement.Data.Exceptions.InvalidRequestException,
Microsoft.VisualStudio.Services.ReleaseManagement2.Data","typeKey":"InvalidRequestException","errorCode":0,"eventId":3000}
Steps to Recreate:
- Create release from existing release definition without triggering any stages on the web portal: https://vsrm.dev.azure.com
- Get release details by invoking:
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}?api-version=5.1-preview.8
- Update response from step 2 with value for release scoped variable with
"allowOverride"
set to true - Update response from step 2 with "modifiedOn" property set to later date than existing value
- Update response from step 2 with "definitionSnapshotRevision" property set to existing value incremented by 1
- Update release by invoking:
PUT https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}?api-version=5.1-preview.8
and providing json generated in steps 2-5 - Observe above mentioned exception
I have updated 2 release properties (modifiedOn and definitionSnapshotRevision) because I saw that these values change if I update a release using web site (https://vsrm.dev.azure.com). It seems that I am still missing something. I cannot find any guidance in documentation on how to properly update a release deployment.