Skip to content

Commit 5435255

Browse files
authored
Merge pull request #113269 from tfitzmac/0429copy
update copy limits
2 parents 44adb14 + da0c860 commit 5435255

File tree

5 files changed

+81
-39
lines changed

5 files changed

+81
-39
lines changed

articles/azure-resource-manager/templates/copy-outputs.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This article shows you how to create more than one value for an output in your A
1010

1111
You can also use copy with [resources](copy-resources.md), [properties in a resource](copy-properties.md), and [variables](copy-variables.md).
1212

13-
## Outputs iteration
13+
## Syntax
1414

1515
The copy element has the following general format:
1616

@@ -25,6 +25,21 @@ The **count** property specifies the number of iterations you want for the outpu
2525

2626
The **input** property specifies the properties that you want to repeat. You create an array of elements constructed from the value in the **input** property. It can be a single property (like a string), or an object with several properties.
2727

28+
## Copy limits
29+
30+
The count can't exceed 800.
31+
32+
The count can't be a negative number. It can be zero if you deploy the template with a recent version of Azure CLI, PowerShell, or REST API. Specifically, you must use:
33+
34+
* Azure PowerShell **2.6** or later
35+
* Azure CLI **2.0.74** or later
36+
* REST API version **2019-05-10** or later
37+
* [Linked deployments](linked-templates.md) must use API version **2019-05-10** or later for the deployment resource type
38+
39+
Earlier versions of PowerShell, CLI, and the REST API don't support zero for count.
40+
41+
## Outputs iteration
42+
2843
The following example creates a variable number of storage accounts and returns an endpoint for each storage account:
2944

3045
```json

articles/azure-resource-manager/templates/copy-properties.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This article shows you how to create more than one instance of a property in you
1010

1111
You can also use copy with [resources](copy-resources.md), [variables](copy-variables.md), and [outputs](copy-outputs.md).
1212

13-
## Property iteration
13+
## Syntax
1414

1515
The copy element has the following general format:
1616

@@ -30,6 +30,21 @@ The **count** property specifies the number of iterations you want for the prope
3030

3131
The **input** property specifies the properties that you want to repeat. You create an array of elements constructed from the value in the **input** property.
3232

33+
## Copy limits
34+
35+
The count can't exceed 800.
36+
37+
The count can't be a negative number. It can be zero if you deploy the template with a recent version of Azure CLI, PowerShell, or REST API. Specifically, you must use:
38+
39+
* Azure PowerShell **2.6** or later
40+
* Azure CLI **2.0.74** or later
41+
* REST API version **2019-05-10** or later
42+
* [Linked deployments](linked-templates.md) must use API version **2019-05-10** or later for the deployment resource type
43+
44+
Earlier versions of PowerShell, CLI, and the REST API don't support zero for count.
45+
46+
## Property iteration
47+
3348
The following example shows how to apply `copy` to the dataDisks property on a virtual machine:
3449

3550
```json
@@ -227,12 +242,6 @@ You can use resource and property iteration together. Reference the property ite
227242
}
228243
```
229244

230-
## Copy limits
231-
232-
The count can't exceed 800.
233-
234-
The count can't be a negative number. If you deploy a template with Azure PowerShell 2.6 or later, Azure CLI 2.0.74 or later, or REST API version **2019-05-10** or later, you can set count to zero. Earlier versions of PowerShell, CLI, and the REST API don't support zero for count.
235-
236245
## Example templates
237246

238247
The following example shows a common scenario for creating more than one value for a property.

articles/azure-resource-manager/templates/copy-resources.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Deploy multiple instances of resources
33
description: Use copy operation and arrays in an Azure Resource Manager template to deploy resource type many times.
44
ms.topic: conceptual
5-
ms.date: 09/27/2019
5+
ms.date: 04/29/2020
66
---
77
# Resource iteration in ARM templates
88

@@ -12,7 +12,7 @@ You can also use copy with [properties](copy-properties.md), [variables](copy-va
1212

1313
If you need to specify whether a resource is deployed at all, see [condition element](conditional-resource-deployment.md).
1414

15-
## Resource iteration
15+
## Syntax
1616

1717
The copy element has the following general format:
1818

@@ -29,6 +29,23 @@ The **name** property is any value that identifies the loop. The **count** prope
2929

3030
Use the **mode** and **batchSize** properties to specify if the resources are deployed in parallel or in sequence. These properties are described in [Serial or Parallel](#serial-or-parallel).
3131

32+
## Copy limits
33+
34+
The count can't exceed 800.
35+
36+
The count can't be a negative number. It can be zero if you deploy the template with a recent version of Azure CLI, PowerShell, or REST API. Specifically, you must use:
37+
38+
* Azure PowerShell **2.6** or later
39+
* Azure CLI **2.0.74** or later
40+
* REST API version **2019-05-10** or later
41+
* [Linked deployments](linked-templates.md) must use API version **2019-05-10** or later for the deployment resource type
42+
43+
Earlier versions of PowerShell, CLI, and the REST API don't support zero for count.
44+
45+
Be careful using [complete mode deployment](deployment-modes.md) with copy. If you redeploy with complete mode to a resource group, any resources that aren't specified in the template after resolving the copy loop are deleted.
46+
47+
## Resource iteration
48+
3249
The following example creates the number of storage accounts specified in the **storageCount** parameter.
3350

3451
```json
@@ -252,14 +269,6 @@ The following example shows the implementation:
252269
}]
253270
```
254271

255-
## Copy limits
256-
257-
The count can't exceed 800.
258-
259-
The count can't be a negative number. If you deploy a template with Azure PowerShell 2.6 or later, Azure CLI 2.0.74 or later, or REST API version **2019-05-10** or later, you can set count to zero. Earlier versions of PowerShell, CLI, and the REST API don't support zero for count.
260-
261-
Be careful using [complete mode deployment](deployment-modes.md) with copy. If you redeploy with complete mode to a resource group, any resources that aren't specified in the template after resolving the copy loop are deleted.
262-
263272
## Example templates
264273

265274
The following examples show common scenarios for creating more than one instance of a resource or property.

articles/azure-resource-manager/templates/copy-variables.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This article shows you how to create more than one value for a variable in your
1010

1111
You can also use copy with [resources](copy-resources.md), [properties in a resource](copy-properties.md), and [outputs](copy-outputs.md).
1212

13-
## Variable iteration
13+
## Syntax
1414

1515
The copy element has the following general format:
1616

@@ -28,6 +28,21 @@ The **name** property is any value that identifies the loop. The **count** prope
2828

2929
The **input** property specifies the properties that you want to repeat. You create an array of elements constructed from the value in the **input** property. It can be a single property (like a string), or an object with several properties.
3030

31+
## Copy limits
32+
33+
The count can't exceed 800.
34+
35+
The count can't be a negative number. It can be zero if you deploy the template with a recent version of Azure CLI, PowerShell, or REST API. Specifically, you must use:
36+
37+
* Azure PowerShell **2.6** or later
38+
* Azure CLI **2.0.74** or later
39+
* REST API version **2019-05-10** or later
40+
* [Linked deployments](linked-templates.md) must use API version **2019-05-10** or later for the deployment resource type
41+
42+
Earlier versions of PowerShell, CLI, and the REST API don't support zero for count.
43+
44+
## Variable iteration
45+
3146
The following example shows how to create an array of string values:
3247

3348
```json
@@ -289,12 +304,6 @@ The next example shows the different ways you can use copy with variables.
289304
}
290305
```
291306

292-
## Copy limits
293-
294-
The count can't exceed 800.
295-
296-
The count can't be a negative number. If you deploy a template with Azure PowerShell 2.6 or later, Azure CLI 2.0.74 or later, or REST API version **2019-05-10** or later, you can set count to zero. Earlier versions of PowerShell, CLI, and the REST API don't support zero for count.
297-
298307
## Example templates
299308

300309
The following examples show common scenarios for creating more than one value for a variable.

articles/azure-resource-manager/templates/linked-templates.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Link templates for deployment
33
description: Describes how to use linked templates in an Azure Resource Manager template to create a modular template solution. Shows how to pass parameters values, specify a parameter file, and dynamically created URLs.
44
ms.topic: conceptual
5-
ms.date: 12/11/2019
5+
ms.date: 04/29/2020
66
---
77
# Using linked and nested templates when deploying Azure resources
88

@@ -29,7 +29,7 @@ To nest a template, add a [deployments resource](/azure/templates/microsoft.reso
2929
"resources": [
3030
{
3131
"name": "nestedTemplate1",
32-
"apiVersion": "2017-05-10",
32+
"apiVersion": "2019-10-01",
3333
"type": "Microsoft.Resources/deployments",
3434
"properties": {
3535
"mode": "Incremental",
@@ -58,7 +58,7 @@ The following example deploys a storage account through a nested template.
5858
"resources": [
5959
{
6060
"name": "nestedTemplate1",
61-
"apiVersion": "2017-05-10",
61+
"apiVersion": "2019-10-01",
6262
"type": "Microsoft.Resources/deployments",
6363
"properties": {
6464
"mode": "Incremental",
@@ -95,7 +95,7 @@ You set the scope through the `expressionEvaluationOptions` property. By default
9595
```json
9696
{
9797
"type": "Microsoft.Resources/deployments",
98-
"apiVersion": "2017-05-10",
98+
"apiVersion": "2019-10-01",
9999
"name": "nestedTemplate1",
100100
"properties": {
101101
"expressionEvaluationOptions": {
@@ -118,7 +118,7 @@ The following template demonstrates how template expressions are resolved accord
118118
"resources": [
119119
{
120120
"type": "Microsoft.Resources/deployments",
121-
"apiVersion": "2017-05-10",
121+
"apiVersion": "2019-10-01",
122122
"name": "nestedTemplate1",
123123
"properties": {
124124
"expressionEvaluationOptions": {
@@ -202,7 +202,7 @@ The following example deploys a SQL server and retrieves a key vault secret to u
202202
"resources": [
203203
{
204204
"type": "Microsoft.Resources/deployments",
205-
"apiVersion": "2018-05-01",
205+
"apiVersion": "2019-10-01",
206206
"name": "dynamicSecret",
207207
"properties": {
208208
"mode": "Incremental",
@@ -286,7 +286,7 @@ To link a template, add a [deployments resource](/azure/templates/microsoft.reso
286286
"resources": [
287287
{
288288
"type": "Microsoft.Resources/deployments",
289-
"apiVersion": "2017-05-10",
289+
"apiVersion": "2019-10-01",
290290
"name": "linkedTemplate",
291291
"properties": {
292292
"mode": "Incremental",
@@ -323,7 +323,7 @@ You can provide the parameters for your linked template either in an external fi
323323
"resources": [
324324
{
325325
"type": "Microsoft.Resources/deployments",
326-
"apiVersion": "2018-05-01",
326+
"apiVersion": "2019-10-01",
327327
"name": "linkedTemplate",
328328
"properties": {
329329
"mode": "Incremental",
@@ -346,7 +346,7 @@ To pass parameter values inline, use the **parameters** property.
346346
"resources": [
347347
{
348348
"type": "Microsoft.Resources/deployments",
349-
"apiVersion": "2018-05-01",
349+
"apiVersion": "2019-10-01",
350350
"name": "linkedTemplate",
351351
"properties": {
352352
"mode": "Incremental",
@@ -409,7 +409,7 @@ The following example template shows how to use copy with a nested template.
409409
"resources": [
410410
{
411411
"type": "Microsoft.Resources/deployments",
412-
"apiVersion": "2018-05-01",
412+
"apiVersion": "2019-10-01",
413413
"name": "[concat('nestedTemplate', copyIndex())]",
414414
// yes, copy works here
415415
"copy":{
@@ -483,7 +483,7 @@ The main template deploys the linked template and gets the returned value. Notic
483483
"resources": [
484484
{
485485
"type": "Microsoft.Resources/deployments",
486-
"apiVersion": "2018-05-01",
486+
"apiVersion": "2019-10-01",
487487
"name": "linkedTemplate",
488488
"properties": {
489489
"mode": "Incremental",
@@ -590,7 +590,7 @@ To use the public IP address from the preceding template when deploying a load b
590590
},
591591
{
592592
"type": "Microsoft.Resources/deployments",
593-
"apiVersion": "2018-05-01",
593+
"apiVersion": "2019-10-01",
594594
"name": "linkedTemplate",
595595
"properties": {
596596
"mode": "Incremental",
@@ -663,7 +663,7 @@ The following template links to the preceding template. It creates three public
663663
"resources": [
664664
{
665665
"type": "Microsoft.Resources/deployments",
666-
"apiVersion": "2018-05-01",
666+
"apiVersion": "2019-10-01",
667667
"name": "[concat('linkedTemplate', copyIndex())]",
668668
"copy": {
669669
"count": 3,
@@ -730,7 +730,7 @@ The following example shows how to pass a SAS token when linking to a template:
730730
"resources": [
731731
{
732732
"type": "Microsoft.Resources/deployments",
733-
"apiVersion": "2018-05-01",
733+
"apiVersion": "2019-10-01",
734734
"name": "linkedTemplate",
735735
"properties": {
736736
"mode": "Incremental",

0 commit comments

Comments
 (0)