Trigger VSTS/TFS build based on blob

2019-07-10 04:38发布

问题:

Is it possible to trigger an VSTS/TFS build based on the condition if a blob in a storage account is updated?

I tried to create a function app, but with little to no result, I cannot trigger a VSTS/TFS build.

回答1:

Easiest solution (from my understanding) will be to use a logic app:

  • Create a logic app that is triggered whenever a blob is added/updated into a specific container.
  • Queue a VSTS build

NOTE

your VSTS account should have "Third-party application access via OAuth" enabled. (Go to Administration > Control panel > Settings page)



回答2:

According to the official docs, it is possible to:

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

Then, the only thing the Azure function should do it to 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 - it contains the basic samples to quickly get up to speed.