Skip to content

Commit 893e077

Browse files
authored
Merge pull request #192492 from schaffererin/0311-batch-quickstart
Creating new Bicep quickstart - Batch
2 parents ae28338 + 5d49df7 commit 893e077

File tree

3 files changed

+107
-1
lines changed

3 files changed

+107
-1
lines changed

articles/azure-resource-manager/bicep/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
href: ../../event-hubs/event-hubs-bicep-namespace-event-hub.md?toc=/azure/azure-resource-manager/bicep/toc.json
5252
- name: Compute
5353
items:
54+
- name: Batch
55+
href: ../../batch/quick-create-bicep.md?toc=/azure/azure-resource-manager/bicep/toc.json
5456
- name: Linux virtual machine
5557
href: ../../virtual-machines/linux/quick-create-bicep.md?toc=/azure/azure-resource-manager/bicep/toc.json
5658
- name: Windows virtual machine

articles/batch/TOC.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@
2020
- name: Run a Batch job - Python
2121
displayName: quickstart, first, create
2222
href: quick-run-python.md
23+
- name: Create a Batch account - Bicep
24+
href: quick-create-bicep.md
25+
displayName: Resource Manager, ARM, Template
2326
- name: Create a Batch account - ARM template
2427
href: quick-create-template.md
25-
displayName: Resource Manager, quickstart, first, create
28+
displayName: Resource Manager
2629
- name: Tutorials
2730
items:
2831
- name: Parallel file processing - .NET

articles/batch/quick-create-bicep.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Azure Quickstart - Create a Batch account - Bicep file
3+
description: This quickstart shows how to create a Batch account by using a Bicep file.
4+
author: schaffererin
5+
ms.date: 03/22/2022
6+
ms.topic: quickstart
7+
ms.author: v-eschaffer
8+
ms.custom: subject-armqs, mode-arm
9+
tags: azure-resource-manager, bicep
10+
---
11+
12+
# Quickstart: Create a Batch account by using a Bicep file
13+
14+
Get started with Azure Batch by using a Bicep file to create a Batch account, including storage. You need a Batch account to create compute resources (pools of compute nodes) and Batch jobs. You can link an Azure Storage account with your Batch account, which is useful to deploy applications and store input and output data for most real-world workloads.
15+
16+
After completing this quickstart, you'll understand the key concepts of the Batch service and be ready to try Batch with more realistic workloads at larger scale.
17+
18+
[!INCLUDE [About Bicep](../../includes/resource-manager-quickstart-bicep-introduction.md)]
19+
20+
## Prerequisites
21+
22+
You must have an active Azure subscription.
23+
24+
- [!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
25+
26+
## Review the Bicep file
27+
28+
The Bicep file used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/batchaccount-with-storage/).
29+
30+
:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.batch/batchaccount-with-storage/main.bicep":::
31+
32+
Two Azure resources are defined in the Bicep file:
33+
34+
- [Microsoft.Storage/storageAccounts](/azure/templates/microsoft.storage/storageaccounts): Creates a storage account.
35+
- [Microsoft.Batch/batchAccounts](/azure/templates/microsoft.batch/batchaccounts): Creates a Batch account.
36+
37+
## Deploy the Bicep file
38+
39+
1. Save the Bicep file as **main.bicep** to your local computer.
40+
1. Deploy the Bicep file using either Azure CLI or Azure PowerShell.
41+
42+
# [CLI](#tab/CLI)
43+
44+
```azurecli
45+
az group create --name exampleRG --location eastus
46+
az deployment group create --resource-group exampleRG --template-file main.bicep
47+
```
48+
49+
# [PowerShell](#tab/PowerShell)
50+
51+
```azurepowershell
52+
New-AzResourceGroup -Name exampleRG -Location eastus
53+
New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep
54+
```
55+
56+
---
57+
58+
When the deployment finishes, you should see a message indicating the deployment succeeded.
59+
60+
## Validate the deployment
61+
62+
Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.
63+
64+
# [CLI](#tab/CLI)
65+
66+
```azurecli-interactive
67+
az resource list --resource-group exampleRG
68+
```
69+
70+
# [PowerShell](#tab/PowerShell)
71+
72+
```azurepowershell-interactive
73+
Get-AzResource -ResourceGroupName exampleRG
74+
```
75+
76+
---
77+
78+
## Clean up resources
79+
80+
If you plan to continue on with more of our [tutorials](./tutorial-parallel-dotnet.md), you may want to leave these resources in place. When no longer needed, use the Azure portal, Azure CLI, or Azure PowerShell to delete the resource group and all of its resources.
81+
82+
# [CLI](#tab/CLI)
83+
84+
```azurecli-interactive
85+
az group delete --name exampleRG
86+
```
87+
88+
# [PowerShell](#tab/PowerShell)
89+
90+
```azurepowershell-interactive
91+
Remove-AzResourceGroup -Name exampleRG
92+
```
93+
94+
---
95+
96+
## Next steps
97+
98+
In this quickstart, you created a Batch account and a storage account using Bicep. To learn more about Azure Batch, continue to the Azure Batch tutorials.
99+
100+
> [!div class="nextstepaction"]
101+
> [Azure Batch tutorials](./tutorial-parallel-dotnet.md)

0 commit comments

Comments
 (0)