How to put the job fail information in the Azure Batch jobs list

Yue Wang 20 Reputation points
2026-08-05T03:05:54.7166667+00:00

In the Jobs list of Azure Batch, it only shows the state of Completed of the jobs, even if the job are failed, this is very confusion, and I have to click into the specific job see the status and exit code.
Is there a way to show the task running result into the Jobs list, including the task result not just job completed?

Thanks!

Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.

0 comments No comments

Answer accepted by question author
Megha Ramakrishnan 335 Reputation points
2026-08-06T14:34:41.8566667+00:00

Hi @Yue Wang ,

Yes, this behaviour is expected. Task result cannot currently be added directly to the standard Azure portal Jobs list.

In Azure Batch, the job state Completed is a lifecycle state. It means that all tasks in the job have terminated and that the job will no longer accept additional tasks or changes. It does not mean that every task completed successfully. A task can reach the Completed state after succeeding, failing after exhausting its retry limit, failing to start, or being terminated.

At present, the Azure portal’s Jobs list does not provide a built-in column that aggregates task success or failure for each job. Therefore, the job can appear as Completed even when one or more of its tasks failed.

You can use one of the following alternatives.

1. Retrieve task counts with Azure CLI

The following command returns the number of active, running, completed, succeeded, and failed tasks for a job:

az batch job task-counts show \
  --job-id <job-id> \
  --account-name <batch-account-name> \
  --account-endpoint <batch-account-endpoint>

2. Use the Batch API or SDK

Azure Batch provides the Get Job Task Counts operation, which returns aggregate counts for successful and failed tasks. The operation is available through the Batch REST API and supported SDKs.

3. Use Azure Monitor for multiple jobs

For an account-level view, Azure Monitor exposes the following Batch metrics:

Task Complete Events

Task Fail Events

Both metrics support the jobId dimension. You can split the metric by job ID, create an Azure dashboard showing failed tasks per job, and optionally configure an alert when the failed-task count is greater than zero.

--please don't forget to close up the thread here by marking answer if the reply is helpful--

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author
Vincentius Indrayanto 20 Reputation points
2026-08-05T09:07:13.8966667+00:00

hi @Yue Wang based on the current Azure Batch behavior, this isn't supported directly in the Azure portal. The Jobs list displays the job lifecycle state (such as Active or Completed), but it doesn't summarize whether the tasks within the job succeeded or failed. A job can appear as Completed simply because all tasks have finished running, even if some of them ended with errors.

To determine the execution result, you'll need to open the job and review the Tasks list, including the execution information and exit codes for each task.

If you need a high-level view of failed jobs, a common approach is to send Azure Batch logs and metrics to Azure Monitor or Log Analytics and build a custom workbook or dashboard that summarizes task failures across jobs. At the moment, there isn't a built-in option in the Azure portal to display aggregated task success or failure status directly in the Jobs list.

I hope this helps.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Suchitra Suregaunkar 16,530 Reputation points Microsoft External Staff Moderator
    2026-08-09T17:23:18.8+00:00

    Hi @Yue Wang ,

    Thank you for posting your query on Microsoft Q&A platform.

    The behavior you're seeing is expected. In Azure Batch, Completed at the job level is a lifecycle state it means all tasks have terminated and the job accepts no further work. It does not indicate that every task succeeded. A task always transitions to Completed whether it succeeded or failed; the actual result is carried in the task's taskExecutionResult, exitCode, and failureInfo properties

    Check for job and task errors.

    There is currently no built-in column in the portal Jobs list that aggregates task success/failure per job.

    To avoid clicking into each job, you can use any of the following:

    1. Task counts APIaz batch job task-counts show --job-id <job-id> --account-name <account> returns succeeded and failed task counts per job.
    2. Azure Monitor – the Batch metrics Task Complete Events and Task Fail Events support the jobId dimension. Split by job ID to build a dashboard of failed tasks per job, and add an alert when failed tasks > 0.
    3. Make the job reflect the failure – set the job's onTaskFailure to performExitOptionsJobAction and define exitConditions on your tasks with jobAction = terminatejob. The job then terminates on task failure with terminateReason = taskFailed OnTaskFailure enum. Note this stops the job at the first failure, so use it only if that matches your workflow.

    Also make sure tasks persist stdout/stderr via outputFiles to Azure Storage node task files are cleaned up once the job completes and the node recycles.

    Thanks,

    Suchitra.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.