首页 > 解决方案 > Get TFS Webhook SubscriptionStatus

问题描述

From my previous question link here it appears that we do not have a feature in any version of TFS/Azure DevOps to setup monitoring for the webhook subscriptions.

As a workaround I'm now looking to write a PowerShell script to check the heartbeat of the subscription. From the Microsoft documentation link here it appears we can get the SubscriptionStatus by querying the subscription ID.

On a GET request for below API I receive all the details specified in the documentation but I'm unable to find "status" in the response. Does anybody know if there is any other way to get the SubscriptionStatus.

https://collectionurl/_apis/hooks/subscriptions/3d9af4ba-d642-4c80-8d62-34cabca322f9

标签: azuretfsazure-devopsazure-devops-rest-api

解决方案


尝试列出订阅:

GET https://collectionurl/_apis/hooks/subscriptions?api-version=5.1

您可以使用查询参数过滤结果,如下所示:

GET https://collectionurl/_apis/hooks/subscriptions?publisherId={publisherId}&eventType={eventType}&consumerId={consumerId}&consumerActionId={consumerActionId}&api-version=5.1

你应该status在某个地方看到那里。


推荐阅读