Class CloudJob | Azure SDK for Net
Matthew Sanders
Published Feb 16, 2026
An Azure Batch job.
Inheritance
CloudJob
Namespace: Microsoft.Azure.Batch
Assembly: Microsoft.Azure.Batch.dll
Syntax
public class CloudJob : Microsoft.Azure.Batch.IInheritedBehaviors, Microsoft.Azure.Batch.IRefreshable Properties
CommonEnvironmentSettings
Gets or sets a list of common environment variable settings. These environment variables are set for all tasks in this CloudJob (including the Job Manager, Job Preparation and Job Release tasks).
Declaration
public System.Collections.Generic.IList<Microsoft.Azure.Batch.EnvironmentSetting> CommonEnvironmentSettings { get; set; } Property Value
Constraints
Gets or sets the execution constraints for the job.
Declaration
public Microsoft.Azure.Batch.JobConstraints Constraints { get; set; } Property Value
CreationTime
Gets the creation time of the job.
Declaration
public Nullable<DateTime> CreationTime { get; } Property Value
CustomBehaviors
Gets or sets a list of behaviors that modify or customize requests to the Batch service made via this CloudJob.
Declaration
public System.Collections.Generic.IList<Microsoft.Azure.Batch.BatchClientBehavior> CustomBehaviors { get; set; } Property Value
Implements
DisplayName
Gets or sets the display name of the job.
Declaration
public string DisplayName { get; set; } Property Value
ETag
Gets the ETag for the job.
Declaration
public string ETag { get; } Property Value
ExecutionInformation
Gets the execution information for the job.
Declaration
public Microsoft.Azure.Batch.JobExecutionInformation ExecutionInformation { get; } Property Value
Id
Gets or sets the id of the job.
Declaration
public string Id { get; set; } Property Value
JobManagerTask
Gets or sets the Job Manager task. The Job Manager task is launched when the CloudJob is started.
Declaration
public Microsoft.Azure.Batch.JobManagerTask JobManagerTask { get; set; } Property Value
JobPreparationTask
Gets or sets the Job Preparation task. The Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.
Declaration
public Microsoft.Azure.Batch.JobPreparationTask JobPreparationTask { get; set; } Property Value
JobReleaseTask
Gets or sets the Job Release task. The Batch service runs the Job Release task when the job ends, on each compute node where any task of the job has run.
Declaration
public Microsoft.Azure.Batch.JobReleaseTask JobReleaseTask { get; set; } Property Value
LastModified
Gets the last modified time of the job.
Declaration
public Nullable<DateTime> LastModified { get; } Property Value
Metadata
NetworkConfiguration
Gets or sets the network configuration for the job.
Declaration
public Microsoft.Azure.Batch.JobNetworkConfiguration NetworkConfiguration { get; set; } Property Value
OnAllTasksComplete
Gets or sets the action the Batch service should take when all tasks in the job are in the Completedstate.
Declaration
public Nullable<Microsoft.Azure.Batch.Common.OnAllTasksComplete> OnAllTasksComplete { get; set; } Property Value
OnTaskFailure
Gets or sets the action the Batch service should take when any task in the job fails.
Declaration
public Nullable<Microsoft.Azure.Batch.Common.OnTaskFailure> OnTaskFailure { get; set; } Property Value
PoolInformation
Gets or sets the pool on which the Batch service runs the job's tasks.
Declaration
public Microsoft.Azure.Batch.PoolInformation PoolInformation { get; set; } Property Value
PreviousState
Gets the previous state of the job.
Declaration
public Nullable<Microsoft.Azure.Batch.Common.JobState> PreviousState { get; } Property Value
PreviousStateTransitionTime
Gets the time at which the job entered its previous state.
Declaration
public Nullable<DateTime> PreviousStateTransitionTime { get; } Property Value
Priority
Gets or sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority.
Declaration
public Nullable<int> Priority { get; set; } Property Value
State
Gets the current state of the job.
Declaration
public Nullable<Microsoft.Azure.Batch.Common.JobState> State { get; } Property Value
StateTransitionTime
Gets the time at which the job entered its current state.
Declaration
public Nullable<DateTime> StateTransitionTime { get; } Property Value
Statistics
Gets resource usage statistics for the entire lifetime of the job.
Declaration
public Microsoft.Azure.Batch.JobStatistics Statistics { get; } Property Value
Url
Gets the URL of the job.
Declaration
public string Url { get; } Property Value
UsesTaskDependencies
Gets or sets whether tasks in the job can define dependencies on each other.
Declaration
public Nullable<bool> UsesTaskDependencies { get; set; } Property Value
Methods
AddTask(CloudTask, IEnumerable<BatchClientBehavior>)
Declaration
public System.Collections.Concurrent.ConcurrentDictionary<Type,Microsoft.Azure.Batch.IFileStagingArtifact> AddTask (Microsoft.Azure.Batch.CloudTask taskToAdd, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
Returns
AddTask(IEnumerable<CloudTask>, BatchClientParallelOptions, ConcurrentBag<ConcurrentDictionary<Type,IFileStagingArtifact>>, Nullable<TimeSpan>, IEnumerable<BatchClientBehavior>)
Adds tasks to a job.
Declaration
public void AddTask (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.CloudTask> tasksToAdd, Microsoft.Azure.Batch.BatchClientParallelOptions parallelOptions = null, System.Collections.Concurrent.ConcurrentBag<System.Collections.Concurrent.ConcurrentDictionary<Type,Microsoft.Azure.Batch.IFileStagingArtifact>> fileStagingArtifacts = null, Nullable<TimeSpan> timeout = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
Exceptions
AddTaskAsync(CloudTask, ConcurrentDictionary<Type,IFileStagingArtifact>, IEnumerable<BatchClientBehavior>, CancellationToken)
Declaration
[System.Diagnostics.DebuggerStepThrough]
public System.Threading.Tasks.Task AddTaskAsync (Microsoft.Azure.Batch.CloudTask taskToAdd, System.Collections.Concurrent.ConcurrentDictionary<Type,Microsoft.Azure.Batch.IFileStagingArtifact> allFileStagingArtifacts = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
| Task A Task that represents the asynchronous operation. |
AddTaskAsync(IEnumerable<CloudTask>, BatchClientParallelOptions, ConcurrentBag<ConcurrentDictionary<Type,IFileStagingArtifact>>, Nullable<TimeSpan>, IEnumerable<BatchClientBehavior>)
Adds tasks to a job.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public System.Threading.Tasks.Task AddTaskAsync (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.CloudTask> tasksToAdd, Microsoft.Azure.Batch.BatchClientParallelOptions parallelOptions = null, System.Collections.Concurrent.ConcurrentBag<System.Collections.Concurrent.ConcurrentDictionary<Type,Microsoft.Azure.Batch.IFileStagingArtifact>> fileStagingArtifacts = null, Nullable<TimeSpan> timeout = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
Returns
| Task A Task object that represents the asynchronous operation. |
Exceptions
Commit(IEnumerable<BatchClientBehavior>)
Commits this CloudJob to the Azure Batch service.
Declaration
public void Commit (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
CommitAsync(IEnumerable<BatchClientBehavior>, CancellationToken)
Commits this CloudJob to the Azure Batch service.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public System.Threading.Tasks.Task CommitAsync (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
| Task A Task that represents the asynchronous operation. |
CommitChanges(IEnumerable<BatchClientBehavior>)
Commits all pending changes to this CloudJob to the Azure Batch service.
Declaration
public void CommitChanges (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
CommitChangesAsync(IEnumerable<BatchClientBehavior>, CancellationToken)
Commits all pending changes to this CloudJob to the Azure Batch service.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public System.Threading.Tasks.Task CommitChangesAsync (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
| Task A Task that represents the asynchronous operation. |
Delete(IEnumerable<BatchClientBehavior>)
Declaration
public void Delete (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
DeleteAsync(IEnumerable<BatchClientBehavior>, CancellationToken)
Declaration
public System.Threading.Tasks.Task DeleteAsync (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
| Task A Task that represents the asynchronous operation. |
Disable(DisableJobOption, IEnumerable<BatchClientBehavior>)
Disables this CloudJob. Disabled jobs do not run new tasks, but may be re-enabled later.
Declaration
public void Disable (Microsoft.Azure.Batch.Common.DisableJobOption disableJobOption, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
DisableAsync(DisableJobOption, IEnumerable<BatchClientBehavior>, CancellationToken)
Disables this CloudJob. Disabled jobs do not run new tasks, but may be re-enabled later.
Declaration
public System.Threading.Tasks.Task DisableAsync (Microsoft.Azure.Batch.Common.DisableJobOption disableJobOption, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
| Task A Task that represents the asynchronous operation. |
Enable(IEnumerable<BatchClientBehavior>)
Enables this CloudJob, allowing new tasks to run.
Declaration
public void Enable (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
EnableAsync(IEnumerable<BatchClientBehavior>, CancellationToken)
Enables this CloudJob, allowing new tasks to run.
Declaration
public System.Threading.Tasks.Task EnableAsync (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
| Task A Task that represents the asynchronous operation. |
GetTask(String, DetailLevel, IEnumerable<BatchClientBehavior>)
Declaration
public Microsoft.Azure.Batch.CloudTask GetTask (string taskId, Microsoft.Azure.Batch.DetailLevel detailLevel = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
Returns
GetTaskAsync(String, DetailLevel, IEnumerable<BatchClientBehavior>, CancellationToken)
Declaration
[System.Diagnostics.DebuggerStepThrough]
public System.Threading.Tasks.Task<Microsoft.Azure.Batch.CloudTask> GetTaskAsync (string taskId, Microsoft.Azure.Batch.DetailLevel detailLevel = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
GetTaskCounts(IEnumerable<BatchClientBehavior>)
Gets the task counts for the job.
Declaration
public Microsoft.Azure.Batch.TaskCounts GetTaskCounts (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
Returns
GetTaskCountsAsync(IEnumerable<BatchClientBehavior>, CancellationToken)
Gets the task counts for the job.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public System.Threading.Tasks.Task<Microsoft.Azure.Batch.TaskCounts> GetTaskCountsAsync (System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
ListTasks(DetailLevel, IEnumerable<BatchClientBehavior>)
Declaration
public Microsoft.Azure.Batch.IPagedEnumerable<Microsoft.Azure.Batch.CloudTask> ListTasks (Microsoft.Azure.Batch.DetailLevel detailLevel = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
Returns
Refresh(DetailLevel, IEnumerable<BatchClientBehavior>)
Declaration
public void Refresh (Microsoft.Azure.Batch.DetailLevel detailLevel = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
Implements
RefreshAsync(DetailLevel, IEnumerable<BatchClientBehavior>, CancellationToken)
Declaration
[System.Diagnostics.DebuggerStepThrough]
public System.Threading.Tasks.Task RefreshAsync (Microsoft.Azure.Batch.DetailLevel detailLevel = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
| Task A Task representing the asynchronous refresh operation. |
Implements
Terminate(String, IEnumerable<BatchClientBehavior>)
Terminates this CloudJob, marking it as completed.
Declaration
public void Terminate (string terminateReason = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null); Parameters
TerminateAsync(String, IEnumerable<BatchClientBehavior>, CancellationToken)
Terminates this CloudJob, marking it as completed.
Declaration
public System.Threading.Tasks.Task TerminateAsync (string terminateReason = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null); Parameters
Returns
| Task A Task object that represents the asynchronous operation. |