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 exclusively providing 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 examples. There is no mention of Bash, sh, or Linux-specific command lines, nor are there notes about cross-platform compatibility or how to adapt the examples for Linux compute nodes.
Recommendations:
- Provide parallel Linux/Bash shell examples for all command-line snippets (e.g., use 'bash -c' or 'sh -c' and appropriate environment variable and path syntax).
- Explicitly mention that Batch compute nodes can run both Windows and Linux, and clarify any differences in job preparation/release task scripting.
- Add a section or callout explaining how to write cross-platform scripts for job preparation and release tasks, including tips for detecting the OS and using portable commands.
- Update sample output and file paths to include Linux-style paths (forward slashes) and environment variable syntax ($VAR).
- Where Windows tools or patterns are mentioned, provide Linux equivalents (e.g., 'del' vs. 'rm', '%VAR%' vs. '$VAR').
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...