You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/batch/quick-create-cli.md
+20-18Lines changed: 20 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ ms.date: 04/12/2023
6
6
ms.custom: mvc, devx-track-azurecli, mode-api
7
7
---
8
8
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
10
10
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.
12
12
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.
14
14
15
15
## Prerequisites
16
16
@@ -22,7 +22,7 @@ This quickstart uses the Azure CLI to create and manage Azure resources from the
22
22
23
23
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.
24
24
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.
26
26
27
27
## Create a resource group
28
28
@@ -36,7 +36,9 @@ az group create \
36
36
37
37
## Create a storage account
38
38
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:
40
42
41
43
```azurecli-interactive
42
44
az storage account create \
@@ -58,7 +60,7 @@ az batch account create \
58
60
--location eastus2
59
61
```
60
62
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.
62
64
63
65
```azurecli-interactive
64
66
az batch account login \
@@ -69,7 +71,7 @@ az batch account login \
69
71
70
72
## Create a pool of compute nodes
71
73
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.
73
75
74
76
```azurecli-interactive
75
77
az batch pool create \
@@ -81,14 +83,14 @@ az batch pool create \
81
83
82
84
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.
83
85
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:
85
87
86
88
```azurecli-interactive
87
89
az batch pool show --pool-id myPool \
88
90
--query "allocationState"
89
91
```
90
92
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.
92
94
93
95
## Create a job
94
96
@@ -131,11 +133,11 @@ az batch task show \
131
133
--task-id myTask1
132
134
```
133
135
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.
135
137
136
138
## View task output
137
139
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:
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:
160
162
161
163
```azurecli-interactive
162
164
az batch task file download \
@@ -166,7 +168,7 @@ az batch task file download \
166
168
--destination ./stdout.txt
167
169
```
168
170
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.
@@ -204,7 +206,7 @@ az group delete --name qsBatch
204
206
205
207
## Next steps
206
208
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.
Copy file name to clipboardExpand all lines: articles/batch/quick-create-portal.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,17 @@ ms.topic: quickstart
6
6
ms.custom: mvc, mode-ui
7
7
---
8
8
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
10
10
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.
12
12
13
13
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.
## Create a Batch account and Azure Storage account
21
21
22
22
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
44
44
45
45
## Create a pool of compute nodes
46
46
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.
48
48
49
49
1. On your Batch account page, select **Pools** from the left navigation.
50
50
@@ -62,7 +62,7 @@ Next, create a pool of Windows compute nodes in your Batch account. The followin
62
62
63
63
1. Accept the defaults for the remaining settings, and select **OK** at the bottom of the page.
64
64
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.
66
66
67
67
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.
68
68
@@ -78,13 +78,13 @@ Now create a job to run on the pool. A Batch job is a logical group of one or mo
78
78
79
79
1. Select **Select pool**, and on the **Select pool** page, select **myPool**, and then select **Select**.
80
80
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.
82
82
83
83
## Create tasks
84
84
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.
86
86
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.
88
88
89
89
1. On the **Jobs** page, select **myJob**.
90
90
@@ -112,19 +112,21 @@ The contents of the *stdout.txt* file are similar to the following example:
112
112
113
113
:::image type="content" source="media/quick-create-portal/task-output.png" alt-text="Screenshot of the standard output file from a completed task.":::
114
114
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.
116
116
117
117
## Clean up resources
118
118
119
119
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.
120
120
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.
122
124
123
125
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**.
124
126
125
127
## Next steps
126
128
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.
0 commit comments