【发布时间】:2022-01-02 00:34:34
【问题描述】:
我正在尝试使用 Azure Devops API 创建发布管道,但返回以下错误:
{
"$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
}
我的印象是向https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?api-version=6.0 发送 POST 请求实际上会创建发布管道 - 我误解了这一点吗?
我对此的理解来自这个问题:https://developercommunity.visualstudio.com/t/api-documentation-out-of-date/1437337 这确实帮助我创建了一个构建管道
请在下面找到请求正文 - 请注意,由于我已删除个人和组织信息,因此某些值会有所不同:
{
"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": {}
}
如果有人可以提供任何帮助,或者有任何经验,将不胜感激!
【问题讨论】:
标签: azure-devops azure-pipelines azure-pipelines-release-pipeline azure-devops-rest-api