0

I am trying to use the API "Releases - Update release environment" on Azure devops Server 2019 (Version Dev17.M153.5) to update a variable that is defined within a stage scope. The api returns successful response but sends back the original value of the variable in the stage scope rather than the updated value provided via the api call.

Note: I have a "Pre-deployment approval" configured on the stage that needs the stage scoped variable to be updated. The Api explicitly needs the stage to have an approval failing which I get the following error

{ "$id": "1", "innerException": null, "message": "Invalid input to update stage 'ABC' of release 'Release-123'. Make sure you have pending approvals in the stage.", "typeName": "Microsoft.VisualStudio.Services.ReleaseManagement.Data.Exceptions.InvalidRequestException, Microsoft.VisualStudio.Services.ReleaseManagement2.Data", "typeKey": "InvalidRequestException", "errorCode": 0, "eventId": 3000 }

Any help is highly appreciated

Thanks Sibi JV

Sibi JV
  • 253
  • 2
  • 3
  • 8
  • Is your problem that `API` is rejected by Pre-deployment approval? Did you tried [Approvals - Update](https://learn.microsoft.com/en-us/rest/api/azure/devops/release/approvals/update?view=azure-devops-rest-7.0&tabs=HTTP)? – Minxin Yu - MSFT Dec 01 '22 at 09:42
  • I did not use approvals update rather the "Release -Update release environment" which seems to need the stage to be in "Approval Pending" state (which it is ). When triggered for updating the variable, API responds back with success but returns the current value present in the stage scope rather than the updated one. Please note I have Devops Server 2019 hence have access only to version 5.1 of the API. The approvals update [https://learn.microsoft.com/en-us/rest/api/azure/devops/release/approvals/update?view=azure-devops-rest-5.1&tabs=HTTP] does not have a provision to update variable – Sibi JV Dec 01 '22 at 11:14

0 Answers0