【问题标题】:Error when attempting to create VSTS API Service Hook Subscription尝试创建 VSTS API 服务挂钩订阅时出错
【发布时间】:2018-06-25 19:49:54
【问题描述】:

大家,

我一直致力于通过 API 自动创建 Visual Studio 团队服务 - 服务挂钩订阅。我可以让 TFS 发布者工作,但不能让 RM 发布者工作。我正在尝试为发布部署已完成创建挂钩订阅。即使与我的数据交换,我能找到的任何示例都无法正常工作。 TFS 提供程序完美运行。响应样本... POST https://project.visualstudio.com/_apis/hooks/subscriptions?api-version=4.1-preview

主体:

{
  "publisherId": "rm",
  "eventType": "ms.vss-release.deployment-completed-event",
  "consumerId": "slack",
  "consumerActionId": "postMessageToChannel",
  "publisherInputs": {
    "releaseEnvironmentId" : "777",
    "releaseDefinitionId" : "1",
    "releaseEnvironmentStatus" : "4",
    "projectId" : "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c"
  },
  "consumerInputs": {
    "url": "https://hooks.slack.com/services/myservice/crazyGuidxxxxxxxxxxxxxxxx"
  }
}

回复:

{
    "$id": "1",
    "innerException": null,
    "message": "There is no registered handler for the service hooks event type ms.vss-release.deployment-completed-event.",
    "typeName": "System.InvalidOperationException, mscorlib",
    "typeKey": "InvalidOperationException",
    "errorCode": 0,
    "eventId": 0
}

【问题讨论】:

  • 在你的url中添加vsrm后能解决这个问题吗?
  • 是的,这解决了问题。非常感谢!

标签: visual-studio tfs azure-devops azure-pipelines-release-pipeline azure-devops-rest-api


【解决方案1】:

这是因为您错过了发布网址中的 vsrm。使用下面的api,你会得到一个成功的响应:

POST https://project.vsrm.visualstudio.com/_apis/hooks/subscriptions?api-version=4.1-preview

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-16
    • 2019-11-19
    • 2014-12-02
    • 2020-08-17
    • 1970-01-01
    • 2017-02-15
    • 2021-03-17
    • 1970-01-01
    相关资源
    最近更新 更多