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/azure-resource-manager/templates/template-tutorial-create-multiple-instances.md
+35-13Lines changed: 35 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Create multiple resource instances
3
3
description: Learn how to create an Azure Resource Manager template (ARM template) to create multiple Azure resource instances.
4
4
author: mumian
5
-
ms.date: 04/23/2020
5
+
ms.date: 09/28/2022
6
6
ms.topic: tutorial
7
7
ms.author: jgao
8
8
ms.custom: devx-track-azurepowershell
@@ -43,7 +43,7 @@ To complete this article, you need:
43
43
```
44
44
45
45
1. Select **Open** to open the file.
46
-
1. There is a `Microsoft.Storage/storageAccounts` resource defined in the template. Compare the template to the [template reference](/azure/templates/Microsoft.Storage/storageAccounts). It's helpful to get some basic understanding of the template before customizing it.
46
+
1. There's a `Microsoft.Storage/storageAccounts` resource defined in the template. Compare the template to the [template reference](/azure/templates/Microsoft.Storage/storageAccounts). It's helpful to get some basic understanding of the template before customizing it.
47
47
1. Select **File** > **Save As** to save the file as _azuredeploy.json_ to your local computer.
48
48
49
49
## Edit the template
@@ -55,9 +55,25 @@ From Visual Studio Code, make the following four changes:
1. Add a `copy` element to the storage account resource definition. In the `copy` element, you specify the number of iterations and a variable for this loop. The count value must be a positive integer and can't exceed 800.
58
-
2. The `copyIndex()` function returns the current iteration in the loop. You use the index as the name prefix. `copyIndex()` is zero-based. To offset the index value, you can pass a value in the `copyIndex()` function. For example, `copyIndex(1)`.
59
-
3. Delete the `variables` element, because it's not used anymore.
60
-
4. Delete the `outputs` element. It's no longer needed.
58
+
59
+
```json
60
+
"copy": {
61
+
"name": "storageCopy",
62
+
"count": 3
63
+
},
64
+
```
65
+
66
+
1. The `copyIndex()` function returns the current iteration in the loop. You use the index as the name prefix. `copyIndex()` is zero-based. To offset the index value, you can pass a value in the `copyIndex()` function. For example, `copyIndex(1)`.
@@ -107,6 +127,8 @@ The completed template looks like:
107
127
}
108
128
```
109
129
130
+
Save the changes.
131
+
110
132
For more information about creating multiple instances, see [Resource iteration in ARM templates](./copy-resources.md)
111
133
112
134
## Deploy the template
@@ -146,7 +168,7 @@ For more information about creating multiple instances, see [Resource iteration
146
168
147
169
---
148
170
149
-
After a successful template deployment you can display the three storage accounts created in the specified resource group. Compare the storage account names with the name definition in the template.
171
+
After a successful template deployment, you can display the three storage accounts created in the specified resource group. Compare the storage account names with the name definition in the template.
0 commit comments