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