Skip to content

Commit c6f63a7

Browse files
committed
edits
1 parent bbf319c commit c6f63a7

File tree

4 files changed

+64
-60
lines changed

4 files changed

+64
-60
lines changed

articles/batch/quick-create-cli.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ ms.date: 04/12/2023
66
ms.custom: mvc, devx-track-azurecli, mode-api
77
---
88

9-
# Quickstart: Use the Azure CLI to create an Azure Batch account and run a job
9+
# Quickstart: Use the Azure CLI to create a Batch account and run a job
1010

11-
This quickstart shows you how to get started with Azure Batch by using Azure CLI commands. You create a Batch account that has a *pool* of virtual machines, or compute *nodes*. You then create and run a *job* with *tasks* that run on the pool nodes.
11+
This quickstart shows you how to get started with Azure Batch by using Azure CLI commands. You create a Batch account that has a pool of virtual machines, or compute nodes. You then create and run a job with tasks that run on the pool nodes.
1212

13-
This quickstart uses the Azure CLI to create and manage Azure resources from the command line and in a script. After you complete this quickstart, you understand the [key concepts of the Batch service](batch-service-workflow-features.md) and are ready to use Batch with more realistic, larger scale workloads.
13+
This quickstart uses Azure CLI commands and scripts to create and manage Batch resources. After you complete this quickstart, you understand the [key concepts of the Batch service](batch-service-workflow-features.md) and are ready to use Batch with more realistic, larger scale workloads.
1414

1515
## Prerequisites
1616

@@ -22,7 +22,7 @@ This quickstart uses the Azure CLI to create and manage Azure resources from the
2222

2323
You can also [install Azure CLI locally](/cli/azure/install-azure-cli) to run the commands. The steps in this article require Azure CLI version 2.0.20 or later. Run [az version](/cli/azure/reference-index?#az-version) to see your installed version and dependent libraries, and run [az upgrade](/cli/azure/reference-index?#az-upgrade) to upgrade.
2424

25-
If you use a local installation, sign in to Azure by using the [az login](/cli/azure/reference-index#az-login) command. If you're prompted on first use, install the Azure CLI extension.
25+
If you use a local installation, sign in to Azure by using the [az login](/cli/azure/reference-index#az-login) command.
2626

2727
## Create a resource group
2828

@@ -36,7 +36,9 @@ az group create \
3636

3737
## Create a storage account
3838

39-
Use the [az storage account create](/cli/azure/storage/account#az-storage-account-create) command to create an Azure Storage account to link to your Batch account. Although this quickstart doesn't use the storage account, most real-world Batch workloads use a linked storage account to deploy applications and store input and output data. Run the following command to create a `Stamdard_LRS` SKU storage account named `mybatchstorage` in your resource group:
39+
Use the [az storage account create](/cli/azure/storage/account#az-storage-account-create) command to create an Azure Storage account to link to your Batch account. Although this quickstart doesn't use the storage account, most real-world Batch workloads use a linked storage account to deploy applications and store input and output data.
40+
41+
Run the following command to create a `Stamdard_LRS` SKU storage account named `mybatchstorage` in your resource group:
4042

4143
```azurecli-interactive
4244
az storage account create \
@@ -58,7 +60,7 @@ az batch account create \
5860
--location eastus2
5961
```
6062

61-
Sign in to the new Batch account by running the [az batch account login](/cli/azure/batch/account#az-batch-account-login) command. After you authenticate with Batch, the remaining `az batch` commands use this account context to create and manage compute pools and jobs.
63+
Sign in to the new Batch account by running the [az batch account login](/cli/azure/batch/account#az-batch-account-login) command. After you authenticate with Batch, the rest of the `az batch` quickstart commands use this account context.
6264

6365
```azurecli-interactive
6466
az batch account login \
@@ -69,7 +71,7 @@ az batch account login \
6971

7072
## Create a pool of compute nodes
7173

72-
Use the [az batch pool create](/cli/azure/batch/pool#az-batch-pool-create) command to create a pool of Linux compute nodes in your Batch account. The following example creates a pool named `myPool` that consists of two `Standard_A1_v2` size nodes running `Ubuntu 18.04 LTS` OS. The node size offers a good balance of performance versus cost for this quickstart example.
74+
Use the [az batch pool create](/cli/azure/batch/pool#az-batch-pool-create) command to create a pool of Linux compute nodes in your Batch account. The following example creates a pool named `myPool` that consists of two `Standard_A1_v2` size nodes running `Ubuntu 18.04 LTS` OS. This node size offers a good balance of performance versus cost for this quickstart example.
7375

7476
```azurecli-interactive
7577
az batch pool create \
@@ -81,14 +83,14 @@ az batch pool create \
8183

8284
Batch creates the pool immediately, but takes a few minutes to allocate and start the compute nodes. During this time, the pool is in the `resizing` state.
8385

84-
To see the pool status, run the [az batch pool show](/cli/azure/batch/pool#az-batch-pool-show) command. This command shows all the properties of the pool, and you can query for specific properties. The following command shows the pool allocation state:
86+
To see the pool status, run the [az batch pool show](/cli/azure/batch/pool#az-batch-pool-show) command. This command shows all the properties of the pool, and you can query for specific properties. The following command queries for the pool allocation state:
8587

8688
```azurecli-interactive
8789
az batch pool show --pool-id myPool \
8890
--query "allocationState"
8991
```
9092

91-
You can do the following steps to create a job and tasks while the pool state is changing. The pool is ready to run tasks when the allocation state is `steady` and all the nodes are running.
93+
You can do the following steps to create a job and tasks while the pool state is still `resizing`. The pool is ready to run tasks when the allocation state is `steady` and all the nodes are running.
9294

9395
## Create a job
9496

@@ -131,11 +133,11 @@ az batch task show \
131133
--task-id myTask1
132134
```
133135

134-
The command output includes many details, but note the `nodeId` and the task command line `exitCode`. The `nodeId` shows the name of the pool node that ran the task. An `exitCode` of `0` indicates that the task command line completed successfully.
136+
The command output includes many details. For example, the `nodeId` shows the name of the pool node that ran the task. An `exitCode` of `0` indicates that the task command line completed successfully.
135137

136138
## View task output
137139

138-
Use the [az batch task file list](/cli/azure/batch/task) command to list the files a task created on a node. The following command lists the files that `myTask1` created:
140+
Use the [az batch task file list](/cli/azure/batch/task#az-batch-task-file-show) command to list the files a task created on a node. The following command lists the files that `myTask1` created:
139141

140142
```azurecli-interactive
141143
az batch task file list \
@@ -147,16 +149,16 @@ az batch task file list \
147149
Results are similar to the following output:
148150

149151
```output
150-
Name URL Is Directory Content Length
151-
---------- ------------------------------------------------------------------------------------------ -------------- ----------------
152+
Name URL Is Directory Content Length
153+
---------- ---------------------------------------------------------------------------------------- -------------- ----------------
152154
stdout.txt https://mybatchaccount.eastus2.batch.azure.com/jobs/myJob/tasks/myTask1/files/stdout.txt False 695
153155
certs https://mybatchaccount.eastus2.batch.azure.com/jobs/myJob/tasks/myTask1/files/certs True
154156
wd https://mybatchaccount.eastus2.batch.azure.com/jobs/myJob/tasks/myTask1/files/wd True
155-
stderr.txt https://mybatchaccount.eastus2.batch.azure.com/jobs/myJob/tasks/myTask1/files/stderr.txt False 0
157+
stderr.txt https://mybatchaccount.eastus2.batch.azure.com/jobs/myJob/tasks/myTask1/files/stderr.txt False 0
156158
157159
```
158160

159-
Use the [az batch task file download](/cli/azure/batch/task) command to download output files to a local directory. The following example downloads the *stdout.txt* file:
161+
Use the [az batch task file download](/cli/azure/batch/task#az-batch-task-file-download) command to download output files to a local directory. The following example downloads the *stdout.txt* file:
160162

161163
```azurecli-interactive
162164
az batch task file download \
@@ -166,7 +168,7 @@ az batch task file download \
166168
--destination ./stdout.txt
167169
```
168170

169-
You can view the contents of the *stdout.txt* output file in a text editor. The following example shows a typical *stdout.txt* file. The standard output from this task shows the Azure Batch environment variables that are set on the node. You can reference these environment variables in your Batch job task command lines, and in the apps and scripts the command lines run.
171+
You can view the contents of the standard output file in a text editor. The following example shows a typical *stdout.txt* file. The standard output from this task shows the Azure Batch environment variables that are set on the node. You can refer to these environment variables in your Batch job task command lines, and in the apps and scripts the command lines run.
170172

171173
```text
172174
AZ_BATCH_TASK_DIR=/mnt/batch/tasks/workitems/myJob/job-1/myTask1
@@ -204,7 +206,7 @@ az group delete --name qsBatch
204206

205207
## Next steps
206208

207-
In this quickstart, you created a Batch account and pool, and created and ran a Batch job and tasks. You learned how to view task output from the nodes. Now that you understand the key concepts of the Batch service, you're ready to use Batch with more realistic, larger scale workloads. To learn more about Azure Batch, continue to the Azure Batch tutorials.
209+
In this quickstart, you created a Batch account and pool, created and ran a Batch job and tasks, and viewed task output from the nodes. Now that you understand the key concepts of the Batch service, you're ready to use Batch with more realistic, larger scale workloads. To learn more about Azure Batch, continue to the Azure Batch tutorials.
208210

209211
> [!div class="nextstepaction"]
210-
> [Azure Batch tutorials](./tutorial-parallel-dotnet.md)
212+
> [Tutorial: Run a parallel workload with Azure Batch](./tutorial-parallel-python.md)

articles/batch/quick-create-portal.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ ms.topic: quickstart
66
ms.custom: mvc, mode-ui
77
---
88

9-
# Quickstart: Use the Azure portal to create an Azure Batch account and run a job
9+
# Quickstart: Use the Azure portal to create a Batch account and run a job
1010

11-
This quickstart shows you how to get started with Azure Batch by using the Azure portal. You create a Batch account that has a *pool* of virtual machines, or compute *nodes*. You then create and run a *job* with *tasks* that run on the pool nodes.
11+
This quickstart shows you how to get started with Azure Batch by using the Azure portal. You create a Batch account that has a pool of virtual machines, or compute nodes. You then create and run a job with tasks that run on the pool nodes.
1212

1313
After you complete this quickstart, you understand the [key concepts of the Batch service](batch-service-workflow-features.md) and are ready to use Batch with more realistic, larger scale workloads.
1414

1515
## Prerequisites
1616

1717
- [!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
1818

19-
<a name="create-a-batch-account></a>
19+
<a name="create-a-batch-account"></a>
2020
## Create a Batch account and Azure Storage account
2121

2222
You need a Batch account to create pools and jobs. The following steps create an example Batch account. You also create an Azure Storage account to link to your Batch account. Although this quickstart doesn't use the storage account, most real-world Batch workloads use a linked storage account to deploy applications and store input and output data.
@@ -44,7 +44,7 @@ You need a Batch account to create pools and jobs. The following steps create an
4444

4545
## Create a pool of compute nodes
4646

47-
Next, create a pool of Windows compute nodes in your Batch account. The following steps create a pool that consists of two Standard_A1_v2 size compute nodes running Windows Server 2019. The suggested node size offers a good balance of performance versus cost for this quickstart.
47+
Next, create a pool of Windows compute nodes in your Batch account. The following steps create a pool that consists of two Standard_A1_v2 size compute nodes running Windows Server 2019. This node size offers a good balance of performance versus cost for this quickstart.
4848

4949
1. On your Batch account page, select **Pools** from the left navigation.
5050

@@ -62,7 +62,7 @@ Next, create a pool of Windows compute nodes in your Batch account. The followin
6262

6363
1. Accept the defaults for the remaining settings, and select **OK** at the bottom of the page.
6464

65-
Batch creates the pool immediately, but takes a few minutes to allocate and start the compute nodes. On the **Pools** page, select **myPool** to go to the **myPool** page and see the pool status of **Resizing** under **Essentials** > **Allocation state**. You can do the following steps to create a job and tasks while the pool state is still changing.
65+
Batch creates the pool immediately, but takes a few minutes to allocate and start the compute nodes. On the **Pools** page, select **myPool** to go to the **myPool** page and see the pool status of **Resizing** under **Essentials** > **Allocation state**. You can do the following steps to create a job and tasks while the pool state is still resizing.
6666

6767
After a few minutes, the **Allocation state** changes to **Steady**, and the nodes start. To check the state of the nodes, select **Nodes** in the **myPool** page left navigation. When a node's state is **Idle**, it's ready to run tasks.
6868

@@ -78,13 +78,13 @@ Now create a job to run on the pool. A Batch job is a logical group of one or mo
7878

7979
1. Select **Select pool**, and on the **Select pool** page, select **myPool**, and then select **Select**.
8080

81-
1. On the **Add job** page, select **OK**. Batch creates the job, and it appears on the **Jobs** page.
81+
1. On the **Add job** page, select **OK**. Batch creates the job and lists it on the **Jobs** page.
8282

8383
## Create tasks
8484

85-
Create tasks to run in the job. You can create multiple tasks that Batch queues and distributes to run on the compute nodes. When you create a task, you specify your app or script in a command line. Batch provides several ways to deploy apps and scripts to compute nodes.
85+
Jobs can contain multiple tasks that Batch queues and distributes to run on the compute nodes. When you create a task, you specify your app or script in a command line. Batch provides several ways to deploy apps and scripts to compute nodes.
8686

87-
The following procedure creates and runs two identical tasks. Each task runs a command line that displays the Batch environment variables on the compute node, and then waits 90 seconds.
87+
The following procedure creates and runs two identical tasks in your job. Each task runs a command line that displays the Batch environment variables on the compute node, and then waits 90 seconds.
8888

8989
1. On the **Jobs** page, select **myJob**.
9090

@@ -112,19 +112,21 @@ The contents of the *stdout.txt* file are similar to the following example:
112112

113113
:::image type="content" source="media/quick-create-portal/task-output.png" alt-text="Screenshot of the standard output file from a completed task.":::
114114

115-
The standard output for this task shows the Azure Batch environment variables that are set on the node. You can reference these environment variables in your Batch job task command lines, and in the apps and scripts the command lines run.
115+
The standard output for this task shows the Azure Batch environment variables that are set on the node. You can refer to these environment variables in your Batch job task command lines, and in the apps and scripts the command lines run.
116116

117117
## Clean up resources
118118

119119
If you want to continue with Batch tutorials and samples, you can use the Batch account and linked storage account that you created in this quickstart. There's no charge for the Batch account itself.
120120

121-
Pools and nodes incur charges while the nodes are running, even if they aren't running jobs. When you no longer need a pool, delete it. On your Batch account page, select **Pools** from the left navigation. Select the pool to delete on the **Pools** page, and then select **Delete** on the pool page. Deleting a pool deletes all task output on the nodes, and the nodes themselves.
121+
Pools and nodes incur charges while the nodes are running, even if they aren't running jobs. When you no longer need a pool, delete it.
122+
123+
To delete a pool, on your Batch account page, select **Pools** from the left navigation. Select the pool to delete on the **Pools** page, and then select **Delete** on the pool page. Deleting a pool deletes all task output on the nodes, and the nodes themselves.
122124

123125
When you no longer need any of the resources you created for this quickstart, you can delete the resource group and all its resources, including the storage account, Batch account, and node pools. To delete the resource group, select **Delete resource group** at the top of the **qsBatch** resource group page. On the **Delete a resource group** screen, enter the resource group name *qsBatch*, and then select **Delete**.
124126

125127
## Next steps
126128

127-
In this quickstart, you created a Batch account and pool, and created and ran a Batch job and tasks. You learned how to monitor node and task status, and view task output from the nodes. Now that you understand the key concepts of the Batch service, you're ready to use Batch with more realistic, larger scale workloads. To learn more about Azure Batch, continue to the Azure Batch tutorials.
129+
In this quickstart, you created a Batch account and pool, and created and ran a Batch job and tasks. You monitored node and task status, and viewed task output from the nodes. Now that you understand the key concepts of the Batch service, you're ready to use Batch with more realistic, larger scale workloads. To learn more about Azure Batch, continue to the Azure Batch tutorials.
128130

129131
> [!div class="nextstepaction"]
130132
> [Azure Batch tutorials](./tutorial-parallel-dotnet.md)

0 commit comments

Comments
 (0)