Description | : Note that each Task must have a unique ID. The Batch service may not return the results for each Task in the same order the Tasks were submitted in this request. If the server times out or the connection is closed during the request, the request may have been partially or fully processed, or not at all. In such cases, the user should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request. For example, you should use the same Task IDs during a retry so that if the prior operation succeeded, the retry will not create extra Tasks unexpectedly. If the response contains any Tasks which failed to add, a client can retry the request. In a retry, it is most efficient to resubmit only Tasks that failed to add, and to omit Tasks that were successfully added on the first attempt. The maximum lifetime of a Task from addition to completion is 180 days. If a Task has not completed within 180 days of being added it will be terminated by the Batch service and left in whatever state it was in at that time. |
Reference | : Link ¶ |
⚶ Changes
{ "#id": "Tasks_CreateTaskCollection", "$parameters": { "taskCollection": { "$properties": { "value": { "$properties": [ { "#name": "commandLine", "Description": { "new": "The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables).", "old": "The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables)." } } ] } } } } }
⚼ Request
POST:
/jobs/{jobId}/addtaskcollection
{
api-version:
string
,
timeOut:
integer
,
client-request-id:
string
,
return-client-request-id:
boolean
,
ocp-date:
string
,
jobId:
string
,
taskCollection:
}
{
,
value:
}
[
]
,
{
,
id:
string
,
displayName:
string
,
exitConditions:
{
,
exitCodes:
[
]
,
{
,
code:
integer
,
exitOptions:
}
{
,
jobAction:
enum
,
dependencyAction:
enum
,
}
exitCodeRanges:
[
]
,
{
,
start:
integer
,
end:
integer
,
exitOptions:
}
{
,
jobAction:
enum
,
dependencyAction:
enum
,
}
preProcessingError:
{
,
jobAction:
enum
,
dependencyAction:
enum
,
}
fileUploadError:
{
,
jobAction:
enum
,
dependencyAction:
enum
,
}
default:
}
{
,
jobAction:
enum
,
dependencyAction:
enum
,
}
commandLine:
string
,
containerSettings:
{
,
containerRunOptions:
string
,
imageName:
string
,
registry:
{
,
username:
string
,
password:
string
,
registryServer:
string
,
identityReference:
}
{
,
resourceId:
string
,
}
workingDirectory:
enum
,
containerHostBatchBindMounts:
}
[
]
,
{
,
source:
enum
,
isReadOnly:
boolean
,
}
resourceFiles:
[
]
,
{
,
autoStorageContainerName:
string
,
storageContainerUrl:
string
,
httpUrl:
string
,
blobPrefix:
string
,
filePath:
string
,
fileMode:
string
,
identityReference:
}
{
,
resourceId:
string
,
}
outputFiles:
[
]
,
{
,
filePattern:
string
,
destination:
{
,
container:
}
{
,
path:
string
,
containerUrl:
string
,
identityReference:
{
,
resourceId:
string
,
}
uploadHeaders:
}
[
]
,
{
,
name:
string
,
value:
string
,
}
uploadOptions:
}
{
,
uploadCondition:
enum
,
}
environmentSettings:
[
]
,
{
,
name:
string
,
value:
string
,
}
affinityInfo:
{
,
affinityId:
string
,
}
constraints:
{
,
maxWallClockTime:
string
,
retentionTime:
string
,
maxTaskRetryCount:
integer
,
}
requiredSlots:
integer
,
userIdentity:
{
,
username:
string
,
autoUser:
}
{
,
scope:
enum
,
elevationLevel:
enum
,
}
multiInstanceSettings:
{
,
numberOfInstances:
integer
,
coordinationCommandLine:
string
,
commonResourceFiles:
}
[
]
,
{
,
autoStorageContainerName:
string
,
storageContainerUrl:
string
,
httpUrl:
string
,
blobPrefix:
string
,
filePath:
string
,
fileMode:
string
,
identityReference:
}
{
,
resourceId:
string
,
}
dependsOn:
{
,
taskIds:
[
,
string
,
]
taskIdRanges:
}
[
]
,
{
,
start:
integer
,
end:
integer
,
}
applicationPackageReferences:
[
]
,
{
,
applicationId:
string
,
version:
string
,
}
authenticationTokenSettings:
}
{
,
access:
}
[
,
string
,
]
⚐ Response (200)
{
$headers:
{
,
etag:
string
,
last-modified:
string
,
client-request-id:
string
,
request-id:
string
,
}
$schema:
}
{
,
value:
}
[
]
,
{
,
status:
enum
,
taskId:
string
,
eTag:
string
,
lastModified:
string
,
location:
string
,
error:
}
{
,
code:
string
,
message:
{
,
lang:
string
,
value:
string
,
}
values:
}
[
]
,
{
,
key:
string
,
value:
string
,
}
⚐ Response (default)
{
code:
string
,
message:
{
,
lang:
string
,
value:
string
,
}
values:
}
[
]
,
{
,
key:
string
,
value:
string
,
}