0

I'm trying to create a release pipeline using the Azure Devops API and I've got back the following error:

{
    "$id": "1",
    "innerException": null,
    "message": "VS402936: Release pipeline with ID 467 does not exist. Specify a valid ID and try again.",
    "typeName": "Microsoft.VisualStudio.Services.ReleaseManagement.WebApi.Exceptions.ReleaseDefinitionNotFoundException, Microsoft.VisualStudio.Services.ReleaseManagement.WebApi",
    "typeKey": "ReleaseDefinitionNotFoundException",
    "errorCode": 0,
    "eventId": 3000
}

I was under the impression that sending a POST request to https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?api-version=6.0 would actually create the release pipeline - have I misunderstood this?

My understanding of this came from this question: https://developercommunity.visualstudio.com/t/api-documentation-out-of-date/1437337 which did help me create a build pipeline

Please find the request body below - note some values will be different as I've removed personal and organisational information:

{
  "id": 467,
  "name": "testProject",
  "source": "restApi",
  "revision": 1,
  "description": "Built by project_setup.py",
  "createdBy": null,
  "createdOn": "2021-11-23T10:55:39.418Z",
  "modifiedBy": null,
  "modifiedOn": "2021-11-23T10:55:39.418Z",
  "isDeleted": false,
  "variables": {},
  "variableGroups": [],
  "environments": [
    {
      "id": 628,
      "name": "dev",
      "retentionPolicy": {
        "daysToKeep": 30,
        "releasesToKeep": 3,
        "retainBuild": true
      },
      "preDeployApprovals": {
        "approvals": [
          {
            "rank": 1,
            "isAutomated": false,
            "isNotificationOn": false,
            "approver": {
              "displayName": null,
              "id": "aeb95c63-4fac-4948-84ce-711b0a9dda97"
            },
            "id": 628
          }
        ]
      },
      "postDeployApprovals": {
        "approvals": [
          {
            "rank": 1,
            "isAutomated": true,
            "isNotificationOn": false,
            "id": 628
          }
        ]
      },
      "deployPhases": [
        {
          "deploymentInput": {
            "parallelExecution": {
              "parallelExecutionType": "none"
            },
            "skipArtifactsDownload": false,
            "artifactsDownloadInput": {},
            "queueId": 154,
            "demands": [],
            "enableAccessToken": false,
            "timeoutInMinutes": 0,
            "jobCancelTimeoutInMinutes": 1,
            "condition": "succeeded()",
            "overrideInputs": {}
          },
          "rank": 1,
          "phaseType": "agentBasedDeployment",
          "name": "Run on agent",
          "workflowTasks": []
        }
      ],
      "environmentOptions": {
        "emailNotificationType": "OnlyOnFailure",
        "emailRecipients": "release.environment.owner;release.creator",
        "skipArtifactsDownload": false,
        "timeoutInMinutes": 0,
        "enableAccessToken": false,
        "publishDeploymentStatus": false,
        "badgeEnabled": false,
        "autoLinkWorkItems": false,
        "pullRequestDeploymentEnabled": false
      },
      "demands": [],
      "conditions": [],
      "executionPolicy": {
        "concurrencyCount": 0,
        "queueDepthCount": 0
      },
      "schedules": [],
      "properties": {},
      "preDeploymentGates": {
        "id": 628,
        "gatesOptions": null,
        "gates": []
      },
      "postDeploymentGates": {
        "id": 628,
        "gatesOptions": null,
        "gates": []
      },
      "environmentTriggers": [],
      "rank": 1,
      "owner": {
        "displayName": "<myemail>",
        "url": "https://dev.azure.com/<mycompany>/_apis_Identities/<myid>",
        "_links": {
          "avatar": {
            "href": "https://dev.azure.com/w2globaldata/_apis/GraphProfile/MemberAvatars/<mydescriptor>"
          }
        },
        "id": "<myid>",
        "uniqueName": "<myemail>",
        "imageUrl": "https://dev.azure.com/<company>/_api/_common/identityImage?id=<myid>",
        "descriptor": "<mydescriptor>"
      }
    }
  ],
  "artifacts": [],
  "triggers": [],
  "releaseNameFormat": null,
  "tags": [],
  "properties": {},
  "projectReference": null,
  "_links": {}
}

If anyone could offer any help, or has any experience of this it would be much appreciated!

1 Answer 1

1

That depends on what you want to create.... In your case, it seems like you want to update an existing release definition with id 467 that you are defined in the body:

{ "id": 467, }

If you want to create a release definition, you have to use this example: Create release definition. So try to remove the ID property.

If you want to create new release of an existing release definitions, use this example: Sample Request

Sign up to request clarification or add additional context in comments.

1 Comment

Awesome thats working - thank you so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.