Skip to content

Commit 4cfd82e

Browse files
Merge pull request #238827 from mumian/0518-arm-freshness1
ARM templates content freshness batch 1
2 parents 27c0092 + 21bf15c commit 4cfd82e

21 files changed

+106
-102
lines changed

articles/azure-resource-manager/templates/add-template-to-azure-pipelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: CI/CD with Azure Pipelines and templates
33
description: Describes how to configure continuous integration in Azure Pipelines by using Azure Resource Manager templates. It shows how to use a PowerShell script, or copy files to a staging location and deploy from there.
44
ms.topic: conceptual
55
ms.custom: devx-track-azurepowershell, devx-track-arm-template
6-
ms.date: 02/07/2022
6+
ms.date: 05/22/2023
77
---
88
# Integrate ARM templates with Azure Pipelines
99

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

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Deploy multiple instances of resources
33
description: Use copy operation and arrays in an Azure Resource Manager template (ARM template) to deploy resource type many times.
44
ms.topic: conceptual
55
ms.custom: devx-track-arm-template
6-
ms.date: 05/07/2021
6+
ms.date: 05/22/2023
77
---
88

99
# Resource iteration in ARM templates
@@ -59,26 +59,30 @@ The following example creates the number of storage accounts specified in the `s
5959
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
6060
"contentVersion": "1.0.0.0",
6161
"parameters": {
62+
"location": {
63+
"type": "string",
64+
"defaultValue": "[resourceGroup().location]"
65+
},
6266
"storageCount": {
6367
"type": "int",
6468
"defaultValue": 3
6569
}
6670
},
6771
"resources": [
6872
{
73+
"copy": {
74+
"name": "storagecopy",
75+
"count": "[length(range(0, parameters('storageCount')))]"
76+
},
6977
"type": "Microsoft.Storage/storageAccounts",
70-
"apiVersion": "2019-04-01",
71-
"name": "[concat(copyIndex(),'storage', uniqueString(resourceGroup().id))]",
72-
"location": "[resourceGroup().location]",
78+
"apiVersion": "2022-09-01",
79+
"name": "[format('{0}storage{1}', range(0, parameters('storageCount'))[copyIndex()], uniqueString(resourceGroup().id))]",
80+
"location": "[parameters('location')]",
7381
"sku": {
7482
"name": "Standard_LRS"
7583
},
7684
"kind": "Storage",
77-
"properties": {},
78-
"copy": {
79-
"name": "storagecopy",
80-
"count": "[parameters('storageCount')]"
81-
}
85+
"properties": {}
8286
}
8387
]
8488
}
@@ -117,33 +121,36 @@ The following example creates one storage account for each name provided in the
117121
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
118122
"contentVersion": "1.0.0.0",
119123
"parameters": {
120-
"storageNames": {
121-
"type": "array",
122-
"defaultValue": [
123-
"contoso",
124-
"fabrikam",
125-
"coho"
126-
]
127-
}
124+
"storageNames": {
125+
"type": "array",
126+
"defaultValue": [
127+
"contoso",
128+
"fabrikam",
129+
"coho"
130+
]
131+
},
132+
"location": {
133+
"type": "string",
134+
"defaultValue": "[resourceGroup().location]"
135+
}
128136
},
129137
"resources": [
130138
{
139+
"copy": {
140+
"name": "storagecopy",
141+
"count": "[length(parameters('storageNames'))]"
142+
},
131143
"type": "Microsoft.Storage/storageAccounts",
132-
"apiVersion": "2019-04-01",
133-
"name": "[concat(parameters('storageNames')[copyIndex()], uniqueString(resourceGroup().id))]",
134-
"location": "[resourceGroup().location]",
144+
"apiVersion": "2022-09-01",
145+
"name": "[format('{0}{1}', parameters('storageNames')[copyIndex()], uniqueString(resourceGroup().id))]",
146+
"location": "[parameters('location')]",
135147
"sku": {
136148
"name": "Standard_LRS"
137149
},
138150
"kind": "Storage",
139-
"properties": {},
140-
"copy": {
141-
"name": "storagecopy",
142-
"count": "[length(parameters('storageNames'))]"
143-
}
151+
"properties": {}
144152
}
145-
],
146-
"outputs": {}
153+
]
147154
}
148155
```
149156

@@ -163,26 +170,31 @@ The value for `batchSize` can't exceed the value for `count` in the copy element
163170
{
164171
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
165172
"contentVersion": "1.0.0.0",
173+
"parameters": {
174+
"location": {
175+
"type": "string",
176+
"defaultValue": "[resourceGroup().location]"
177+
}
178+
},
166179
"resources": [
167180
{
168-
"type": "Microsoft.Storage/storageAccounts",
169-
"apiVersion": "2019-04-01",
170-
"name": "[concat(copyIndex(),'storage', uniqueString(resourceGroup().id))]",
171-
"location": "[resourceGroup().location]",
172-
"sku": {
173-
"name": "Standard_LRS"
174-
},
175-
"kind": "Storage",
176181
"copy": {
177182
"name": "storagecopy",
178183
"count": 4,
179184
"mode": "serial",
180185
"batchSize": 2
181186
},
187+
"type": "Microsoft.Storage/storageAccounts",
188+
"apiVersion": "2022-09-01",
189+
"name": "[format('{0}storage{1}', range(0, 4)[copyIndex()], uniqueString(resourceGroup().id))]",
190+
"location": "[parameters('location')]",
191+
"sku": {
192+
"name": "Standard_LRS"
193+
},
194+
"kind": "Storage",
182195
"properties": {}
183196
}
184-
],
185-
"outputs": {}
197+
]
186198
}
187199
```
188200

articles/azure-resource-manager/templates/deploy-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Azure deployment templates with Azure CLI – Azure Resource Manager | Microsoft Docs
33
description: Use Azure Resource Manager and Azure CLI to create and deploy resource groups to Azure. The resources are defined in an Azure deployment template.
44
ms.topic: conceptual
5-
ms.date: 09/17/2021
5+
ms.date: 05/22/2023
66
ms.custom: devx-track-azurecli, seo-azure-cli, devx-track-arm-template
77
keywords: azure cli deploy arm template, create resource group azure, azure deployment template, deployment resources, arm template, azure arm template
88
---

articles/azure-resource-manager/templates/deploy-powershell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Deploy resources with PowerShell and template
33
description: Use Azure Resource Manager and Azure PowerShell to deploy resources to Azure. The resources are defined in a Resource Manager template.
44
ms.topic: conceptual
5-
ms.date: 05/13/2021
5+
ms.date: 05/22/2023
66
ms.custom: devx-track-azurepowershell, devx-track-arm-template
77
---
88

articles/azure-resource-manager/templates/deploy-to-subscription.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Deploy resources to subscription
33
description: Describes how to create a resource group in an Azure Resource Manager template. It also shows how to deploy resources at the Azure subscription scope.
44
ms.topic: conceptual
5-
ms.date: 01/19/2022
5+
ms.date: 05/22/2023
66
ms.custom: devx-track-azurepowershell, devx-track-azurecli, devx-track-arm-template
77
---
88

@@ -235,7 +235,7 @@ The following template creates an empty resource group.
235235
"resources": [
236236
{
237237
"type": "Microsoft.Resources/resourceGroups",
238-
"apiVersion": "2021-04-01",
238+
"apiVersion": "2022-09-01",
239239
"name": "[parameters('rgName')]",
240240
"location": "[parameters('rgLocation')]",
241241
"properties": {}
@@ -266,7 +266,7 @@ Use the [copy element](copy-resources.md) with resource groups to create more th
266266
"resources": [
267267
{
268268
"type": "Microsoft.Resources/resourceGroups",
269-
"apiVersion": "2021-04-01",
269+
"apiVersion": "2022-09-01",
270270
"location": "[parameters('rgLocation')]",
271271
"name": "[concat(parameters('rgNamePrefix'), copyIndex())]",
272272
"copy": {
@@ -305,49 +305,45 @@ The following example creates a resource group, and deploys a storage account to
305305
}
306306
},
307307
"variables": {
308-
"storageName": "[concat(parameters('storagePrefix'), uniqueString(subscription().id, parameters('rgName')))]"
308+
"storageName": "[format('{0}{1}', parameters('storagePrefix'), uniqueString(subscription().id, parameters('rgName')))]"
309309
},
310310
"resources": [
311311
{
312312
"type": "Microsoft.Resources/resourceGroups",
313-
"apiVersion": "2021-04-01",
313+
"apiVersion": "2022-09-01",
314314
"name": "[parameters('rgName')]",
315315
"location": "[parameters('rgLocation')]",
316316
"properties": {}
317317
},
318318
{
319319
"type": "Microsoft.Resources/deployments",
320-
"apiVersion": "2021-04-01",
320+
"apiVersion": "2022-09-01",
321321
"name": "storageDeployment",
322322
"resourceGroup": "[parameters('rgName')]",
323-
"dependsOn": [
324-
"[resourceId('Microsoft.Resources/resourceGroups/', parameters('rgName'))]"
325-
],
326323
"properties": {
327324
"mode": "Incremental",
328325
"template": {
329326
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
330327
"contentVersion": "1.0.0.0",
331-
"parameters": {},
332-
"variables": {},
333328
"resources": [
334329
{
335330
"type": "Microsoft.Storage/storageAccounts",
336-
"apiVersion": "2021-04-01",
331+
"apiVersion": "2022-09-01",
337332
"name": "[variables('storageName')]",
338333
"location": "[parameters('rgLocation')]",
339334
"sku": {
340335
"name": "Standard_LRS"
341336
},
342337
"kind": "StorageV2"
343338
}
344-
],
345-
"outputs": {}
339+
]
346340
}
347-
}
341+
},
342+
"dependsOn": [
343+
"[resourceId('Microsoft.Resources/resourceGroups/', parameters('rgName'))]"
344+
]
348345
}
349-
],
350-
"outputs": {}
346+
]
351347
}
352348
```
353349

articles/azure-resource-manager/templates/deployment-history.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Deployment history
33
description: Describes how to view Azure Resource Manager deployment operations with the portal, PowerShell, Azure CLI, and REST API.
44
tags: top-support-issue
55
ms.topic: conceptual
6-
ms.date: 12/03/2021
6+
ms.date: 05/22/2023
77
ms.custom: devx-track-azurepowershell, devx-track-azurecli, devx-track-arm-template
88
---
99

articles/azure-resource-manager/templates/deployment-modes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Deployment modes
33
description: Describes how to specify whether to use a complete or incremental deployment mode with Azure Resource Manager.
44
ms.topic: conceptual
55
ms.custom: devx-track-arm-template
6-
ms.date: 01/21/2022
6+
ms.date: 05/22/2023
77
---
88
# Azure Resource Manager deployment modes
99

articles/azure-resource-manager/templates/deployment-script-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: mumian
66
ms.service: azure-resource-manager
77
ms.custom: devx-track-arm-template
88
ms.topic: conceptual
9-
ms.date: 05/11/2023
9+
ms.date: 05/22/2023
1010
ms.author: jgao
1111
---
1212

articles/azure-resource-manager/templates/export-template-portal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Export template in Azure portal
33
description: Use Azure portal to export an Azure Resource Manager template from resources in your subscription.
44
ms.topic: conceptual
55
ms.custom: devx-track-arm-template
6-
ms.date: 09/01/2021
6+
ms.date: 05/22/2023
77
---
88
# Use Azure portal to export a template
99

articles/azure-resource-manager/templates/key-vault-parameter.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Key Vault secret with template
33
description: Shows how to pass a secret from a key vault as a parameter during deployment.
44
ms.topic: conceptual
5-
ms.date: 06/18/2021
5+
ms.date: 05/22/2023
66
ms.custom: devx-track-azurepowershell, devx-track-azurecli
77
---
88

@@ -171,31 +171,32 @@ The following template deploys a SQL server that includes an administrator passw
171171
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
172172
"contentVersion": "1.0.0.0",
173173
"parameters": {
174+
"sqlServerName": {
175+
"type": "string"
176+
},
177+
"location": {
178+
"type": "string",
179+
"defaultValue": "[resourceGroup().location]"
180+
},
174181
"adminLogin": {
175182
"type": "string"
176183
},
177184
"adminPassword": {
178185
"type": "securestring"
179-
},
180-
"sqlServerName": {
181-
"type": "string"
182186
}
183187
},
184-
"resources": [
185-
{
188+
"resources": {
189+
"sqlServer": {
186190
"type": "Microsoft.Sql/servers",
187-
"apiVersion": "2015-05-01-preview",
191+
"apiVersion": "2021-11-01",
188192
"name": "[parameters('sqlServerName')]",
189-
"location": "[resourceGroup().location]",
190-
"tags": {},
193+
"location": "[parameters('location')]",
191194
"properties": {
192195
"administratorLogin": "[parameters('adminLogin')]",
193196
"administratorLoginPassword": "[parameters('adminPassword')]",
194197
"version": "12.0"
195198
}
196199
}
197-
],
198-
"outputs": {
199200
}
200201
}
201202
```
@@ -338,7 +339,7 @@ The following template dynamically creates the key vault ID and passes it as a p
338339
"resources": [
339340
{
340341
"type": "Microsoft.Sql/servers",
341-
"apiVersion": "2018-06-01-preview",
342+
"apiVersion": "2021-11-01",
342343
"name": "[variables('sqlServerName')]",
343344
"location": "[parameters('location')]",
344345
"properties": {
@@ -372,9 +373,7 @@ The following template dynamically creates the key vault ID and passes it as a p
372373
}
373374
}
374375
}
375-
],
376-
"outputs": {
377-
}
376+
]
378377
}
379378
```
380379

0 commit comments

Comments
 (0)