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:
⚠️
windows_first
⚠️
missing_linux_example
⚠️
windows_tools
Summary:
The documentation page demonstrates a Windows bias by providing only Windows command-line examples (using 'cmd /c' and Windows environment variable syntax), referencing Windows file paths (with backslashes), and omitting any Linux or cross-platform shell equivalents. There are no examples or guidance for users running Batch tasks on Linux nodes, nor any mention of Bash or POSIX shell syntax. The sample output and code exclusively use Windows conventions.
Recommendations:
- Provide parallel Linux/Bash examples for job preparation and release task command lines, using Bash syntax and POSIX environment variables.
- Mention that both Windows and Linux compute nodes are supported, and clarify any differences in environment variables or file paths.
- Update sample code and output to include both Windows and Linux variants, or use cross-platform examples where possible.
- Explicitly state how to write cross-platform scripts for job preparation and release tasks, or link to relevant documentation.
- Avoid using only Windows-specific tools (e.g., 'cmd', 'del') in examples; include Linux equivalents (e.g., 'bash -c', 'rm').
Create pull request
Flagged Code Snippets
// Create the CloudJob for CloudPool "myPool"
CloudJob myJob =
myBatchClient.JobOperations.CreateJob(
"JobPrepReleaseSampleJob",
new PoolInformation() { PoolId = "myPool" });
// Specify the command lines for the job preparation and release tasks
string jobPrepCmdLine =
"cmd /c echo %AZ_BATCH_NODE_ID% > %AZ_BATCH_NODE_SHARED_DIR%\\shared_file.txt";
string jobReleaseCmdLine =
"cmd /c del %AZ_BATCH_NODE_SHARED_DIR%\\shared_file.txt";
// Assign the job preparation task to the job
myJob.JobPreparationTask =
new JobPreparationTask { CommandLine = jobPrepCmdLine };
// Assign the job release task to the job
myJob.JobReleaseTask =
new JobReleaseTask { CommandLine = jobReleaseCmdLine };
await myJob.CommitAsync();
Attempting to create pool: JobPrepReleaseSamplePool
Created pool JobPrepReleaseSamplePool with 2 nodes
Checking for existing job JobPrepReleaseSampleJob...
Job JobPrepReleaseSampleJob not found, creating...
Submitting tasks and awaiting completion...
All tasks completed.
Contents of shared\job_prep_and_release.txt on tvm-2434664350_1-20160623t173951z:
-------------------------------------------
tvm-2434664350_1-20160623t173951z tasks:
task001
task004
task005
task006
Contents of shared\job_prep_and_release.txt on tvm-2434664350_2-20160623t173951z:
-------------------------------------------
tvm-2434664350_2-20160623t173951z tasks:
task008
task002
task003
task007
Waiting for job JobPrepReleaseSampleJob to reach state Completed
...
tvm-2434664350_1-20160623t173951z:
Prep task exit code: 0
Release task exit code: 0
tvm-2434664350_2-20160623t173951z:
Prep task exit code: 0
Release task exit code: 0
Delete job? [yes] no
yes
Delete pool? [yes] no
yes
Sample complete, hit ENTER to exit...