Azure DevOps: how to update release scoped variables using REST API Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Creating VSTS ServiceHooks (WebHooks) via Rest Api for work item created event fails. Please give a solutionVSTS Items REST API, wildcard not allowedUsing VSTS Rest API, how do you Update a Markdown widget?Create release with title using VSTS REST APICan not update release definition through APIVSTS REST API CachingUnable to update last rundetails in vsts via Rest APIAzure DevOps git policy configurations api broken?How many items we can retrieve at single call in Azure dev ops rest api?No description of attributes in Get Diagnostic Logs in Azure DevOps REST API
One-one communication
NIntegrate on a solution of a matrix ODE
The test team as an enemy of development? And how can this be avoided?
How could a hydrazine and N2O4 cloud (or it's reactants) show up in weather radar?
Twin's vs. Twins'
Can gravitational waves pass through a black hole?
Did any compiler fully use 80-bit floating point?
Is it OK to use the testing sample to compare algorithms?
Noise in Eigenvalues plot
How can I prevent/balance waiting and turtling as a response to cooldown mechanics
An isoperimetric-type inequality inside a cube
Is there a spell that can create a permanent fire?
Why not use the yoke to control yaw, as well as pitch and roll?
Improvising over quartal voicings
Was the pager message from Nick Fury to Captain Marvel unnecessary?
Does the universe have a fixed centre of mass?
Are there any irrational/transcendental numbers for which the distribution of decimal digits is not uniform?
How to resize main filesystem
Do i imagine the linear (straight line) homotopy in a correct way?
How does TikZ render an arc?
New Order #6: Easter Egg
Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?
Fit odd number of triplets in a measure?
Keep at all times, the minus sign above aligned with minus sign below
Azure DevOps: how to update release scoped variables using REST API
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Creating VSTS ServiceHooks (WebHooks) via Rest Api for work item created event fails. Please give a solutionVSTS Items REST API, wildcard not allowedUsing VSTS Rest API, how do you Update a Markdown widget?Create release with title using VSTS REST APICan not update release definition through APIVSTS REST API CachingUnable to update last rundetails in vsts via Rest APIAzure DevOps git policy configurations api broken?How many items we can retrieve at single call in Azure dev ops rest api?No description of attributes in Get Diagnostic Logs in Azure DevOps REST API
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
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.
azure-devops azure-pipelines-release-pipeline azure-devops-rest-api
add a comment |
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.
azure-devops azure-pipelines-release-pipeline azure-devops-rest-api
add a comment |
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.
azure-devops azure-pipelines-release-pipeline azure-devops-rest-api
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.
azure-devops azure-pipelines-release-pipeline azure-devops-rest-api
azure-devops azure-pipelines-release-pipeline azure-devops-rest-api
edited Feb 19 at 18:27
ExaStep
asked Feb 18 at 21:21
ExaStepExaStep
63
63
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I used "Invoke-RestMethod" powershell commandlet to get release metadata. This commandlet returns custom ps object which I then updated, converted to json using "ConvertTo-Json" commandlet and provided in the body of the PUT HTTP request to DevOps to update the release. The issue is that Powershell serialization/de-serialization process of json does not result to the original json.
For example this json property:
"preDeploymentGatesSnapshot":
"id": 0,
"gatesOptions": null,
"gates": []
,
becomes:
"preDeploymentGatesSnapshot": "@id=0; gatesOptions=; gates=System.Object[]"
After I used correct json in the body of the PUT request in the API call:
https://vsrm.dev.azure.com/organization/project/_apis/release/releases/releaseId?api-version=5.1-preview.8
the release got successfully updated.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54755547%2fazure-devops-how-to-update-release-scoped-variables-using-rest-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I used "Invoke-RestMethod" powershell commandlet to get release metadata. This commandlet returns custom ps object which I then updated, converted to json using "ConvertTo-Json" commandlet and provided in the body of the PUT HTTP request to DevOps to update the release. The issue is that Powershell serialization/de-serialization process of json does not result to the original json.
For example this json property:
"preDeploymentGatesSnapshot":
"id": 0,
"gatesOptions": null,
"gates": []
,
becomes:
"preDeploymentGatesSnapshot": "@id=0; gatesOptions=; gates=System.Object[]"
After I used correct json in the body of the PUT request in the API call:
https://vsrm.dev.azure.com/organization/project/_apis/release/releases/releaseId?api-version=5.1-preview.8
the release got successfully updated.
add a comment |
I used "Invoke-RestMethod" powershell commandlet to get release metadata. This commandlet returns custom ps object which I then updated, converted to json using "ConvertTo-Json" commandlet and provided in the body of the PUT HTTP request to DevOps to update the release. The issue is that Powershell serialization/de-serialization process of json does not result to the original json.
For example this json property:
"preDeploymentGatesSnapshot":
"id": 0,
"gatesOptions": null,
"gates": []
,
becomes:
"preDeploymentGatesSnapshot": "@id=0; gatesOptions=; gates=System.Object[]"
After I used correct json in the body of the PUT request in the API call:
https://vsrm.dev.azure.com/organization/project/_apis/release/releases/releaseId?api-version=5.1-preview.8
the release got successfully updated.
add a comment |
I used "Invoke-RestMethod" powershell commandlet to get release metadata. This commandlet returns custom ps object which I then updated, converted to json using "ConvertTo-Json" commandlet and provided in the body of the PUT HTTP request to DevOps to update the release. The issue is that Powershell serialization/de-serialization process of json does not result to the original json.
For example this json property:
"preDeploymentGatesSnapshot":
"id": 0,
"gatesOptions": null,
"gates": []
,
becomes:
"preDeploymentGatesSnapshot": "@id=0; gatesOptions=; gates=System.Object[]"
After I used correct json in the body of the PUT request in the API call:
https://vsrm.dev.azure.com/organization/project/_apis/release/releases/releaseId?api-version=5.1-preview.8
the release got successfully updated.
I used "Invoke-RestMethod" powershell commandlet to get release metadata. This commandlet returns custom ps object which I then updated, converted to json using "ConvertTo-Json" commandlet and provided in the body of the PUT HTTP request to DevOps to update the release. The issue is that Powershell serialization/de-serialization process of json does not result to the original json.
For example this json property:
"preDeploymentGatesSnapshot":
"id": 0,
"gatesOptions": null,
"gates": []
,
becomes:
"preDeploymentGatesSnapshot": "@id=0; gatesOptions=; gates=System.Object[]"
After I used correct json in the body of the PUT request in the API call:
https://vsrm.dev.azure.com/organization/project/_apis/release/releases/releaseId?api-version=5.1-preview.8
the release got successfully updated.
answered Mar 9 at 0:38
ExaStepExaStep
63
63
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54755547%2fazure-devops-how-to-update-release-scoped-variables-using-rest-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown