5

When a certain task fails in an environment I had to always redeploy the whole environment after fixing the issue. Is there a way I could re-initiate only the failed task or just the phase where the task is failed.

For example: In the screenshot below the last task "Run script *" under "Agent Phase" has failed. I had to re-initiate the whole environment deployment to re-execute the last task which will also executes "Run on Agent" phase as well. This is painful during production release pipeline.

enter image description here

Fairoz
  • 828
  • 2
  • 8
  • 21

4 Answers4

10

Recently the retryCountOnTaskFailure argument was introduced:

- task: <name of task>
  retryCountOnTaskFailure: <max number of retries>
   ...
Allan Targino
  • 136
  • 2
  • 4
3

Understand your concern. However, this is not supported at present with on-premises TFS Server 2018.

When you're doing a PROD drop and a step near the end randomly fails, then you can't just rerun from that failed step. Had to re-deploy.

To re-run failed task/step:

Actually, there is a related user voice.

Rerun failed build task/step

https://developercommunity.visualstudio.com/idea/365697/rerun-failed-build-taskstep.html

Multiple people commented and echoed. You could monitor the status of above user voice.

To re-run failed agent phase/ agent job

Also a related user voice:

Retry failed run with multi-stage pipelines

https://developercommunity.visualstudio.com/idea/598906/retry-failed-run-with-multi-stage-pipelines.html

However, this is has been released with Azure DevOps Service now: https://learn.microsoft.com/en-us/azure/devops/release-notes/2019/sprint-158-update#retry-failed-stages Still not available with Azure DevOps/TFS on-premises. Generally, it won't be long until it's released with latest Azure DevOps version.

With all that said, I think you still have to re-deploy on TFS 2018 at present. Sorry for any inconvenience.

William
  • 188
  • 1
  • 8
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
1

In TFS 2018 you don't have this option.

However, in Azure Pipelines you have the option to re-run failed jobs, so I guess in the next release of Azure DevOps Server (TFS) this feature will be.

enter image description here

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
1

You can change the retries from

here

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Toni
  • 11
  • 3
  • 2
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 30 '21 at 10:35