Jobs - List Job Preparation And Release Task Status
Lists the execution status of the Job Preparation and Job Release Task for the
specified Job across the Compute Nodes where the Job has run.
This API returns the Job Preparation and Job Release Task status on all Compute
Nodes that have run the Job Preparation or Job Release Task. This includes
Compute Nodes which have since been removed from the Pool. If this API is
invoked on a Job which has no Job Preparation or Job Release Task, the Batch
service returns HTTP status code 409 (Conflict) with an error code of
JobPreparationTaskNotSpecified.
GET {endpoint}/jobs/{jobId}/jobpreparationandreleasetaskstatus?api-version=2025-06-01
GET {endpoint}/jobs/{jobId}/jobpreparationandreleasetaskstatus?api-version=2025-06-01&timeOut={timeOut}&maxresults={maxresults}&$filter={$filter}&$select={$select}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
Batch account endpoint (for example: https://batchaccount.eastus2.batch.azure.com). |
|
job
|
path | True |
string |
The ID of the Job. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
|
$filter
|
query |
string |
An OData $filter clause. For more information on constructing this filter, see https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. |
|
|
$select
|
query |
string[] |
An OData $select clause. |
|
|
maxresults
|
query |
integer (int32) minimum: 1maximum: 1000 |
The maximum number of items to return in the response. A maximum of 1000 applications can be returned. |
|
|
time
|
query |
integer (int32) |
The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". |
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| client-request-id |
string |
The caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. |
|
| return-client-request-id |
boolean |
Whether the server should return the client-request-id in the response. |
|
| ocp-date |
string (date-time-rfc7231) |
The time the request was issued. Client libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
The request has succeeded. Headers
|
|
| Other Status Codes |
An unexpected error response. |
Security
OAuth2Auth
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Scopes
| Name | Description |
|---|---|
| https://batch.core.windows.net//.default |
Examples
Job list preparation and release task status
Sample request
GET {endpoint}/jobs/jobId/jobpreparationandreleasetaskstatus?api-version=2025-06-01
Sample response
{
"value": [
{
"poolId": "poolId",
"nodeId": "tvm-2167304207_1-20140905t174658z",
"nodeUrl": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2167304207_1-20140905t174658z",
"jobPreparationTaskExecutionInfo": {
"state": "completed",
"startTime": "2015-05-01T10:20:31Z",
"endTime": "2015-05-02T20:12:42Z",
"taskRootDirectory": "tasks/myjob/job-1/myjobpreptask",
"taskRootDirectoryUrl": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2167304207_1-20140905t174658z/files/tasks/myjob/job-1/myjobpreptask",
"exitCode": 0,
"retryCount": 0
},
"jobReleaseTaskExecutionInfo": {
"state": "completed",
"startTime": "2015-05-01T10:20:31Z",
"endTime": "2015-05-02T20:12:42Z",
"taskRootDirectory": "tasks/myjob/job-1/myjobreleasetask",
"taskRootDirectoryUrl": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2167304207_1-20140905t174658z/files/tasks/myjob/job-1/myjobreleasetask",
"exitCode": 0
}
}
],
"odata.nextLink": "https://account.region.batch.azure.com/jobs/myjob/jobpreparationandreleasestatus?$skipToken=tvm-2167304207_1-20140905t174658z&api-version=2025-06-01"
}
Definitions
| Name | Description |
|---|---|
|
Batch |
An error response received from the Azure Batch service. |
|
Batch |
An item of additional information included in an Azure Batch error response. |
|
Batch |
An error message received in an Azure Batch error response. |
|
Batch |
BatchErrorSourceCategory enums |
|
Batch |
The status of the Job Preparation and Job Release Tasks on a Compute Node. |
|
Batch |
The result of listing the status of the Job Preparation and Job Release Tasks for a Job. |
|
Batch |
Contains information about the execution of a Job Preparation Task on a Compute Node. |
|
Batch |
BatchJobPreparationTaskState enums |
|
Batch |
Contains information about the execution of a Job Release Task on a Compute Node. |
|
Batch |
BatchJobReleaseTaskState enums |
|
Batch |
Contains information about the container which a Task is executing. |
|
Batch |
BatchTaskExecutionResult enums |
|
Batch |
Information about a Task failure. |
|
Name |
Represents a name-value pair. |
BatchError
An error response received from the Azure Batch service.
| Name | Type | Description |
|---|---|---|
| code |
string |
An identifier for the error. Codes are invariant and are intended to be consumed programmatically. |
| message |
A message describing the error, intended to be suitable for display in a user interface. |
|
| values |
A collection of key-value pairs containing additional details about the error. |
BatchErrorDetail
An item of additional information included in an Azure Batch error response.
| Name | Type | Description |
|---|---|---|
| key |
string |
An identifier specifying the meaning of the Value property. |
| value |
string |
The additional information included with the error response. |
BatchErrorMessage
An error message received in an Azure Batch error response.
| Name | Type | Description |
|---|---|---|
| lang |
string |
The language code of the error message. |
| value |
string |
The text of the message. |
BatchErrorSourceCategory
BatchErrorSourceCategory enums
| Value | Description |
|---|---|
| usererror |
The error is due to a user issue, such as misconfiguration. |
| servererror |
The error is due to an internal server issue. |
BatchJobPreparationAndReleaseTaskStatus
The status of the Job Preparation and Job Release Tasks on a Compute Node.
| Name | Type | Description |
|---|---|---|
| jobPreparationTaskExecutionInfo |
Information about the execution status of the Job Preparation Task on this Compute Node. |
|
| jobReleaseTaskExecutionInfo |
Information about the execution status of the Job Release Task on this Compute Node. This property is set only if the Job Release Task has run on the Compute Node. |
|
| nodeId |
string |
The ID of the Compute Node to which this entry refers. |
| nodeUrl |
string (uri) |
The URL of the Compute Node to which this entry refers. |
| poolId |
string |
The ID of the Pool containing the Compute Node to which this entry refers. |
BatchJobPreparationAndReleaseTaskStatusListResult
The result of listing the status of the Job Preparation and Job Release Tasks for a Job.
| Name | Type | Description |
|---|---|---|
| odata.nextLink |
string (uri) |
The URL to get the next set of results. |
| value |
A list of Job Preparation and Job Release Task execution information. |
BatchJobPreparationTaskExecutionInfo
Contains information about the execution of a Job Preparation Task on a Compute Node.
| Name | Type | Description |
|---|---|---|
| containerInfo |
Information about the container under which the Task is executing. This property is set only if the Task runs in a container context. |
|
| endTime |
string (date-time) |
The time at which the Job Preparation Task completed. This property is set only if the Task is in the Completed state. |
| exitCode |
integer (int32) |
The exit code of the program specified on the Task command line. This parameter is returned only if the Task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the Compute Node operating system, such as when a process is forcibly terminated. |
| failureInfo |
Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. |
|
| lastRetryTime |
string (date-time) |
The most recent time at which a retry of the Job Preparation Task started running. This property is set only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. |
| result |
The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. |
|
| retryCount |
integer (int32) |
The number of times the Task has been retried by the Batch service. Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. |
| startTime |
string (date-time) |
The time at which the Task started running. If the Task has been restarted or retried, this is the most recent time at which the Task started running. |
| state |
The current state of the Job Preparation Task on the Compute Node. |
|
| taskRootDirectory |
string |
The root directory of the Job Preparation Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. |
| taskRootDirectoryUrl |
string (uri) |
The URL to the root directory of the Job Preparation Task on the Compute Node. |
BatchJobPreparationTaskState
BatchJobPreparationTaskState enums
| Value | Description |
|---|---|
| running |
The Task is currently running (including retrying). |
| completed |
The Task has exited with exit code 0, or the Task has exhausted its retry limit, or the Batch service was unable to start the Task due to Task preparation errors (such as resource file download failures). |
BatchJobReleaseTaskExecutionInfo
Contains information about the execution of a Job Release Task on a Compute Node.
| Name | Type | Description |
|---|---|---|
| containerInfo |
Information about the container under which the Task is executing. This property is set only if the Task runs in a container context. |
|
| endTime |
string (date-time) |
The time at which the Job Release Task completed. This property is set only if the Task is in the Completed state. |
| exitCode |
integer (int32) |
The exit code of the program specified on the Task command line. This parameter is returned only if the Task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the Compute Node operating system, such as when a process is forcibly terminated. |
| failureInfo |
Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. |
|
| result |
The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. |
|
| startTime |
string (date-time) |
The time at which the Task started running. If the Task has been restarted or retried, this is the most recent time at which the Task started running. |
| state |
The current state of the Job Release Task on the Compute Node. |
|
| taskRootDirectory |
string |
The root directory of the Job Release Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. |
| taskRootDirectoryUrl |
string (uri) |
The URL to the root directory of the Job Release Task on the Compute Node. |
BatchJobReleaseTaskState
BatchJobReleaseTaskState enums
| Value | Description |
|---|---|
| running |
The Task is currently running (including retrying). |
| completed |
The Task has exited with exit code 0, or the Task has exhausted its retry limit, or the Batch service was unable to start the Task due to Task preparation errors (such as resource file download failures). |
BatchTaskContainerExecutionInfo
Contains information about the container which a Task is executing.
| Name | Type | Description |
|---|---|---|
| containerId |
string |
The ID of the container. |
| error |
string |
Detailed error information about the container. This is the detailed error string from the Docker service, if available. It is equivalent to the error field returned by "docker inspect". |
| state |
string |
The state of the container. This is the state of the container according to the Docker service. It is equivalent to the status field returned by "docker inspect". |
BatchTaskExecutionResult
BatchTaskExecutionResult enums
| Value | Description |
|---|---|
| success |
The Task ran successfully. |
| failure |
There was an error during processing of the Task. The failure may have occurred before the Task process was launched, while the Task process was executing, or after the Task process exited. |
BatchTaskFailureInfo
Information about a Task failure.
| Name | Type | Description |
|---|---|---|
| category |
The category of the Task error. |
|
| code |
string |
An identifier for the Task error. Codes are invariant and are intended to be consumed programmatically. |
| details |
A list of additional details related to the error. |
|
| message |
string |
A message describing the Task error, intended to be suitable for display in a user interface. |
NameValuePair
Represents a name-value pair.
| Name | Type | Description |
|---|---|---|
| name |
string |
The name in the name-value pair. |
| value |
string |
The value in the name-value pair. |