About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
missing_linux_example
⚠️
windows_tools
⚠️
windows_first
Summary:
The documentation exclusively provides Windows-centric examples and command lines (e.g., 'cmd.exe /c echo'), with no mention of Linux shells, tools, or cross-platform patterns. All code snippets use Windows command syntax, and there is no guidance for users running Batch tasks on Linux pools. This may confuse or exclude Linux users and does not demonstrate parity.
Recommendations:
- For every example using 'cmd.exe /c echo', provide a Linux equivalent using '/bin/bash -c echo' or similar.
- Explicitly mention that Azure Batch supports both Windows and Linux pools, and clarify any differences in task command lines or behaviors.
- Add a section or callout explaining how to adapt the .NET examples for Linux-based pools, including common shell differences.
- Where possible, use cross-platform commands or highlight how to write platform-agnostic task commands.
- Ensure that references to tools or shell environments (e.g., cmd.exe) are balanced with Linux equivalents (e.g., bash), and avoid assuming Windows as the default.
Create pull request
Flagged Code Snippets
// Task 'Flowers' depends on completion of both 'Rain' and 'Sun'
// before it is run.
new CloudTask("Flowers", "cmd.exe /c echo Flowers")
{
DependsOn = TaskDependencies.OnIds("Rain", "Sun")
},
// 'Rain' and 'Sun' don't depend on any other tasks
new CloudTask("Rain", "cmd.exe /c echo Rain"),
new CloudTask("Sun", "cmd.exe /c echo Sun"),
// Task 'Flowers' depends on completion of both 'Rain' and 'Sun'
// before it is run.
new CloudTask("Flowers", "cmd.exe /c echo Flowers")
{
DependsOn = TaskDependencies.OnIds("Rain", "Sun")
},
// Task A is the parent task.
new CloudTask("A", "cmd.exe /c echo A")
{
// Specify exit conditions for task A and their dependency actions.
ExitConditions = new ExitConditions
{
// If task A exits with a pre-processing error, block any downstream tasks (in this example, task B).
PreProcessingError = new ExitOptions
{
DependencyAction = DependencyAction.Block
},
// If task A exits with the specified error codes, block any downstream tasks (in this example, task B).
ExitCodes = new List<ExitCodeMapping>
{
new ExitCodeMapping(10, new ExitOptions() { DependencyAction = DependencyAction.Block }),
new ExitCodeMapping(20, new ExitOptions() { DependencyAction = DependencyAction.Block })
},
// If task A succeeds or fails with any other error, any downstream tasks become eligible to run
// (in this example, task B).
Default = new ExitOptions
{
DependencyAction = DependencyAction.Satisfy
}
}
},
// Task B depends on task A. Whether it becomes eligible to run depends on how task A exits.
new CloudTask("B", "cmd.exe /c echo B")
{
DependsOn = TaskDependencies.OnId("A")
},
// Task 'taskA' doesn't depend on any other tasks
new CloudTask("taskA", "cmd.exe /c echo taskA"),
// Task 'taskB' depends on completion of task 'taskA'
new CloudTask("taskB", "cmd.exe /c echo taskB")
{
DependsOn = TaskDependencies.OnId("taskA")
},
// Tasks 1, 2, and 3 don't depend on any other tasks. Because
// we will be using them for a task range dependency, we must
// specify string representations of integers as their ids.
new CloudTask("1", "cmd.exe /c echo 1"),
new CloudTask("2", "cmd.exe /c echo 2"),
new CloudTask("3", "cmd.exe /c echo 3"),
// Task 4 depends on a range of tasks, 1 through 3
new CloudTask("4", "cmd.exe /c echo 4")
{
// To use a range of tasks, their ids must be integer values.
// Note that we pass integers as parameters to TaskIdRange,
// but their ids (above) are string representations of the ids.
DependsOn = TaskDependencies.OnIdRange(1, 3)
},