Freigeben über


BatchTaskCreateContent(String, String) Constructor

Definition

Initializes a new instance of BatchTaskCreateContent.

public BatchTaskCreateContent (string id, string commandLine);
new Azure.Compute.Batch.BatchTaskCreateContent : string * string -> Azure.Compute.Batch.BatchTaskCreateContent
Public Sub New (id As String, commandLine As String)

Parameters

id
String

A string that uniquely identifies the Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a Job that differ only by case).

commandLine
String

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://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).

Exceptions

id or commandLine is null.

Applies to