successhawk
successhawk

Reputation: 3351

How can I kill (not cancel) an errant Azure Pipeline run, stage, job, or task?

I want to know how to kill an Azure Pipeline task (or any level of execution - run, stage, job, etc.), so that I am not blocked waiting for an errant pipeline to finish executing or timeout. For example, canceling the pipeline does not stop it immediately if a condition is configured incorrectly. If the condition resolves to true the task will execute even if the pipeline is cancelled. This is really painful if your org/project only has 1 agent. :(

Upvotes: 2

Views: 4381

Answers (1)

Leo Liu
Leo Liu

Reputation: 76820

How can I kill (not cancel) an errant Azure Pipeline run, stage, job, or task?

For the hosted agent, we could not kill that azure pipeline directly, since we cannot directly access the running machine.

As workaround, we could reduce the time that the task continues to run after the job is cancelled by setting a shorter Build job cancel timeout in minutes:

enter image description here

For example, I create a pipeline with task, which will still run for 60 minutes after the job is cancelled. But if I set the value of Build job cancel timeout in minutes to 2 mins, the azure pipeline will be cancelled completely.

For the private agent, we could run services.msc, and look for "VSTS Agent (name of your agent)". Right-click the entry and then choose restart.

Upvotes: 1

Related Questions