How to set/update tags via REST API in pipelines releases deployment deployment targets required tag

Copper Contributor

Hi, i am using REST API to create release for deployment group. Because i have multiple targets in deployment groups, i want to create release just for specific target (azagent). I was duing it manually adding required tags in devops but now i am trying to figure it out how to do it with REST API to automate the process. Is there any other was than using tags to create release for specific target in deployment groups?

Create release works fine:

POST https://vsrm.dev.azure.com/{org}/{project}/_apis/release/releases?api-version=7.0

Body: {  "definitionId": 1} 

 

I have tried without success:

PUT https://vsrm.dev.azure.com/{org}/{project}/_apis/release/definitions?api-version=7.0 
Body: {  "definitionId": 1,  "name": "my release",  "tags": ["myTag"] }

PATCH https://vsrm.dev.azure.com/{org}/{project}/_apis/release/definitions/{definitionId}?api-version=7.0 
Body: {  "tags": ["myTag"] }

Thanks for any help and tips!

1 Reply