az batch task
Manage Batch tasks.
Commands
Name | Description | Type | Status |
---|---|---|---|
az batch task create |
Create Batch tasks. |
Core | GA |
az batch task delete |
Deletes a Task from the specified Job. |
Core | GA |
az batch task file |
Manage Batch task files. |
Core | GA |
az batch task file delete |
Deletes the specified Task file from the Compute Node where the Task ran. |
Core | GA |
az batch task file download |
Download the content of a Batch task file. |
Core | GA |
az batch task file list |
Lists the files in a Task's directory on its Compute Node. |
Core | GA |
az batch task file show |
Gets the properties of the specified Task file. |
Core | GA |
az batch task list |
Lists all of the Tasks that are associated with the specified Job. |
Core | GA |
az batch task reactivate |
Reactivates a Task, allowing it to run again even if its retry count has been exhausted. |
Core | GA |
az batch task reset |
Reset the properties of a Batch task. |
Core | GA |
az batch task show |
Gets information about the specified Task. |
Core | GA |
az batch task stop |
Terminates the specified Task. |
Core | GA |
az batch task subtask |
Manage subtask information of a Batch task. |
Core | GA |
az batch task subtask list |
Lists all of the subtasks that are associated with the specified multi-instance Task. |
Core | GA |
az batch task create
Create Batch tasks.
az batch task create --job-id
[--account-endpoint]
[--account-key]
[--account-name]
[--affinity-id]
[--application-package-references]
[--command-line]
[--environment-settings]
[--json-file]
[--max-task-retry-count]
[--max-wall-clock-time]
[--resource-files]
[--retention-time]
[--task-id]
Required Parameters
The ID of the job containing the task.
Optional Parameters
Batch service endpoint. Alternatively, set by environment variable: AZURE_BATCH_ENDPOINT.
The Batch account key. Alternatively, set by environment variable: AZURE_BATCH_ACCESS_KEY.
The Batch account name. Alternatively, set by environment variable: AZURE_BATCH_ACCOUNT.
Required. You can pass the affinityId of a Node to indicate that this Task needs to run on that Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere.
The space-separated list of IDs specifying the application packages to be installed. Space-separated application IDs with optional version in 'id[#version]' format.
The command line of the task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
A list of environment variable settings for the task. Space-separated values in 'key=value' format.
The file containing the task(s) to create in JSON(formatted to match REST API request body). When submitting multiple tasks, accepts either an array of tasks or a TaskAddCollectionParamater. If this parameter is specified, all other parameters are ignored.
The maximum number of times the Task may be retried. The Batch service retries a Task if its exit code is nonzero. Note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code. The Batch service will try the Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the Task after the first attempt. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries).
If this is not specified, there is no time limit on how long the Task may run.
A list of files that the Batch service will download to the compute node before running the command line. Space-separated resource references in filename=httpurl format, with httpurl being any HTTP url with public access or a SAS url with read access.
The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted.
The ID of the task.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az batch task delete
Deletes a Task from the specified Job.
When a Task is deleted, all of the files in its directory on the Compute Node where it ran are also deleted (regardless of the retention time). For multi-instance Tasks, the delete Task operation applies synchronously to the primary task; subtasks and their files are then deleted asynchronously in the background.
az batch task delete --job-id
--task-id
[--account-endpoint]
[--account-key]
[--account-name]
[--if-match]
[--if-modified-since]
[--if-none-match]
[--if-unmodified-since]
[--yes]
Required Parameters
The ID of the Job from which to delete the Task.
The ID of the Task to delete.
Optional Parameters
Batch service endpoint. Alternatively, set by environment variable: AZURE_BATCH_ENDPOINT.
Batch account key. Alternatively, set by environment variable: AZURE_BATCH_ACCESS_KEY.
Batch account name. Alternatively, set by environment variable: AZURE_BATCH_ACCOUNT.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az batch task list
Lists all of the Tasks that are associated with the specified Job.
For multi-instance Tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary Task. Use the list subtasks API to retrieve information about subtasks.
az batch task list --job-id
[--account-endpoint]
[--account-key]
[--account-name]
[--expand]
[--filter]
[--select]
Required Parameters
The ID of the Job.
Optional Parameters
Batch service endpoint. Alternatively, set by environment variable: AZURE_BATCH_ENDPOINT.
Batch account key. Alternatively, set by environment variable: AZURE_BATCH_ACCESS_KEY.
Batch account name. Alternatively, set by environment variable: AZURE_BATCH_ACCOUNT.
An OData $expand clause.
An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks.
An OData $select clause.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az batch task reactivate
Reactivates a Task, allowing it to run again even if its retry count has been exhausted.
Reactivation makes a Task eligible to be retried again up to its maximum retry count. The Task's state is changed to active. As the Task is no longer in the completed state, any previous exit code or failure information is no longer available after reactivation. Each time a Task is reactivated, its retry count is reset to 0. Reactivation will fail for Tasks that are not completed or that previously completed successfully (with an exit code of 0). Additionally, it will fail if the Job has completed (or is terminating or deleting).
az batch task reactivate --job-id
--task-id
[--account-endpoint]
[--account-key]
[--account-name]
[--if-match]
[--if-modified-since]
[--if-none-match]
[--if-unmodified-since]
Required Parameters
The ID of the Job containing the Task.
The ID of the Task to reactivate.
Optional Parameters
Batch service endpoint. Alternatively, set by environment variable: AZURE_BATCH_ENDPOINT.
Batch account key. Alternatively, set by environment variable: AZURE_BATCH_ACCESS_KEY.
Batch account name. Alternatively, set by environment variable: AZURE_BATCH_ACCOUNT.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az batch task reset
Reset the properties of a Batch task.
az batch task reset --job-id
--task-id
[--account-endpoint]
[--account-key]
[--account-name]
[--if-match]
[--if-modified-since]
[--if-none-match]
[--if-unmodified-since]
[--json-file]
[--max-task-retry-count]
[--max-wall-clock-time]
[--retention-time]
Required Parameters
The ID of the Job containing the Task.
The ID of the Task to update.
Optional Parameters
Batch service endpoint. Alternatively, set by environment variable: AZURE_BATCH_ENDPOINT.
Batch account key. Alternatively, set by environment variable: AZURE_BATCH_ACCESS_KEY.
Batch account name. Alternatively, set by environment variable: AZURE_BATCH_ACCOUNT.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time.
A file containing the constraints specification in JSON (formatted to match the respective REST API body). If this parameter is specified, all 'Constraints Arguments' are ignored.
The maximum number of times the Task may be retried. The Batch service retries a Task if its exit code is nonzero. Note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code. The Batch service will try the Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the Task after the first attempt. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries).
If this is not specified, there is no time limit on how long the Task may run. Expected format is an ISO-8601 duration.
The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted. Expected format is an ISO-8601 duration.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az batch task show
Gets information about the specified Task.
For multi-instance Tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary Task. Use the list subtasks API to retrieve information about subtasks.
az batch task show --job-id
--task-id
[--account-endpoint]
[--account-key]
[--account-name]
[--expand]
[--if-match]
[--if-modified-since]
[--if-none-match]
[--if-unmodified-since]
[--select]
Required Parameters
The ID of the Job that contains the Task.
The ID of the Task to get information about.
Optional Parameters
Batch service endpoint. Alternatively, set by environment variable: AZURE_BATCH_ENDPOINT.
Batch account key. Alternatively, set by environment variable: AZURE_BATCH_ACCESS_KEY.
Batch account name. Alternatively, set by environment variable: AZURE_BATCH_ACCOUNT.
An OData $expand clause.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time.
An OData $select clause.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az batch task stop
Terminates the specified Task.
When the Task has been terminated, it moves to the completed state. For multi-instance Tasks, the terminate Task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in the background.
az batch task stop --job-id
--task-id
[--account-endpoint]
[--account-key]
[--account-name]
[--if-match]
[--if-modified-since]
[--if-none-match]
[--if-unmodified-since]
Required Parameters
The ID of the Job containing the Task.
The ID of the Task to terminate.
Optional Parameters
Batch service endpoint. Alternatively, set by environment variable: AZURE_BATCH_ENDPOINT.
Batch account key. Alternatively, set by environment variable: AZURE_BATCH_ACCESS_KEY.
Batch account name. Alternatively, set by environment variable: AZURE_BATCH_ACCOUNT.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time.
An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client.
A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI