Search code examples
pythonazure-batch

Azure Batch re-queue failed tasks


Sometimes tasks might fail due to unforeseen circumstances, such as opening a file that a task(s) needed access to and locking the file.

I would, in such a case, like to simply be able to re-queue my failed task.

How can I re-queue failed tasks in Azure Batch (Python3 or Portal)?


Solution

  • I think by requeue in this context is trying to re-run the fail task:

    You can set the batch_client.config.retry_policy.retries

    SDK doc: https://media.readthedocs.org/pdf/azure-sdk-for-python/v2.0.0rc2/azure-sdk-for-python.pdf

    Sample code: