触发器 VSTS/TFS 基于 blob 构建

Trigger VSTS/TFS build based on blob

如果存储帐户中的 blob 更新,是否可以根据条件触发 VSTS/TFS 构建?

我尝试创建一个函数应用程序,但几乎没有结果,我无法触发 VSTS/TFS 构建。

根据the official docs,可以:

...start a function when a new or updated blob is detected. The blob contents are provided as input to the function.

那么,Azure 函数唯一应该做的就是 queue a build in VSTS with the help of REST API. You might also want to check the Getting Started page of VSTS REST API docs - 它包含快速上手的基本示例。

最简单的解决方案(根据我的理解)是使用 logic app:

  • 创建一个只要 blob added/updated 进入特定容器就会触发的逻辑应用。
  • 排队 VSTS 构建

注意

您的 VSTS 帐户应该已启用 "Third-party application access via OAuth"。 (转到管理 > 控制面板 > 设置页面)