azurepowershellazure-pipelinesdevops

azure devops pipeline retryCountOnTaskFailure, environment variable?


Is there a count variable available to the job/environment such that on retry I could sleep for a minute to hope whatever network traffic caused the failure has time to pass? Something like:

if ($env:retryCount -gt 0) {
  start-sleep 60
}

Solution

  • Although this is not exactly what you are asking for, Azure DevOps supports adding - retryCountOnTaskFailure to a task that allows you to configure retries if the task fails.

    Microsoft doc reference - https://learn.microsoft.com/en-us/azure/devops/pipelines/process/tasks?view=azure-devops&tabs=yaml#number-of-retries-if-task-failed