22title : Configure development environment for deployment scripts in templates | Microsoft Docs
33description : Configure development environment for deployment scripts in Azure Resource Manager templates (ARM templates).
44ms.topic : conceptual
5- ms.date : 12/14/2020
5+ ms.date : 05/23/2023
66ms.custom : devx-track-azurepowershell, devx-track-azurecli, devx-track-arm-template
77ms.devlang : azurecli
88---
@@ -62,6 +62,13 @@ The following Azure Resource Manager template (ARM template) creates a container
6262 "description" : " Specify a project name that is used for generating resource names."
6363 }
6464 },
65+ "location" : {
66+ "type" : " string" ,
67+ "defaultValue" : " [resourceGroup().location]" ,
68+ "metadata" : {
69+ "description" : " Specify the resource location."
70+ }
71+ },
6572 "containerImage" : {
6673 "type" : " string" ,
6774 "defaultValue" : " mcr.microsoft.com/azuredeploymentscripts-powershell:az9.7" ,
@@ -78,20 +85,19 @@ The following Azure Resource Manager template (ARM template) creates a container
7885 }
7986 },
8087 "variables" : {
81- "storageAccountName" : " [tolower(concat(parameters('projectName'), 'store' ))]" ,
82- "fileShareName" : " [concat(parameters('projectName'), 'share' )]" ,
83- "containerGroupName" : " [concat(parameters('projectName'), 'cg' )]" ,
84- "containerName" : " [concat(parameters('projectName'), 'container' )]"
88+ "storageAccountName" : " [toLower(format('{0}store', parameters('projectName') ))]" ,
89+ "fileShareName" : " [format('{0}share', parameters('projectName') )]" ,
90+ "containerGroupName" : " [format('{0}cg', parameters('projectName') )]" ,
91+ "containerName" : " [format('{0}container', parameters('projectName') )]"
8592 },
8693 "resources" : [
8794 {
8895 "type" : " Microsoft.Storage/storageAccounts" ,
89- "apiVersion" : " 2019-06 -01" ,
96+ "apiVersion" : " 2022-09 -01" ,
9097 "name" : " [variables('storageAccountName')]" ,
91- "location" : " [resourceGroup(). location]" ,
98+ "location" : " [parameters(' location') ]" ,
9299 "sku" : {
93- "name" : " Standard_LRS" ,
94- "tier" : " Standard"
100+ "name" : " Standard_LRS"
95101 },
96102 "kind" : " StorageV2" ,
97103 "properties" : {
@@ -100,20 +106,17 @@ The following Azure Resource Manager template (ARM template) creates a container
100106 },
101107 {
102108 "type" : " Microsoft.Storage/storageAccounts/fileServices/shares" ,
103- "apiVersion" : " 2019-06 -01" ,
104- "name" : " [concat(variables('storageAccountName'), '/default/' , variables('fileShareName'))]" ,
109+ "apiVersion" : " 2022-09 -01" ,
110+ "name" : " [format('{0}/default/{1}', variables('storageAccountName') , variables('fileShareName'))]" ,
105111 "dependsOn" : [
106112 " [resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
107113 ]
108114 },
109115 {
110116 "type" : " Microsoft.ContainerInstance/containerGroups" ,
111- "apiVersion" : " 2019-12 -01" ,
117+ "apiVersion" : " 2023-05 -01" ,
112118 "name" : " [variables('containerGroupName')]" ,
113- "location" : " [resourceGroup().location]" ,
114- "dependsOn" : [
115- " [resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
116- ],
119+ "location" : " [parameters('location')]" ,
117120 "properties" : {
118121 "containers" : [
119122 {
@@ -123,7 +126,7 @@ The following Azure Resource Manager template (ARM template) creates a container
123126 "resources" : {
124127 "requests" : {
125128 "cpu" : 1 ,
126- "memoryInGb " : 1.5
129+ "memoryInGB " : " [json(' 1.5')] "
127130 }
128131 },
129132 "ports" : [
@@ -154,11 +157,14 @@ The following Azure Resource Manager template (ARM template) creates a container
154157 "readOnly" : false ,
155158 "shareName" : " [variables('fileShareName')]" ,
156159 "storageAccountName" : " [variables('storageAccountName')]" ,
157- "storageAccountKey" : " [listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06 -01').keys[0].value]"
160+ "storageAccountKey" : " [listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2022-09 -01').keys[0].value]"
158161 }
159162 }
160163 ]
161- }
164+ },
165+ "dependsOn" : [
166+ " storageAccount"
167+ ]
162168 }
163169 ]
164170}
@@ -243,6 +249,13 @@ The following ARM template creates a container instance and a file share, and th
243249 "description": "Specify a project name that is used for generating resource names."
244250 }
245251 },
252+ "location": {
253+ "type": "string",
254+ "defaultValue": "[resourceGroup().location]",
255+ "metadata": {
256+ "description": "Specify the resource location."
257+ }
258+ },
246259 "containerImage": {
247260 "type": "string",
248261 "defaultValue": "mcr.microsoft.com/azure-cli:2.9.1",
@@ -259,20 +272,19 @@ The following ARM template creates a container instance and a file share, and th
259272 }
260273 },
261274 "variables": {
262- "storageAccountName": "[tolower(concat(parameters('projectName'), 'store' ))]",
263- "fileShareName": "[concat(parameters('projectName'), 'share' )]",
264- "containerGroupName": "[concat(parameters('projectName'), 'cg' )]",
265- "containerName": "[concat(parameters('projectName'), 'container' )]"
275+ "storageAccountName": "[toLower(format('{0}store', parameters('projectName') ))]",
276+ "fileShareName": "[format('{0}share', parameters('projectName') )]",
277+ "containerGroupName": "[format('{0}cg', parameters('projectName') )]",
278+ "containerName": "[format('{0}container', parameters('projectName') )]"
266279 },
267280 "resources": [
268281 {
269282 "type": "Microsoft.Storage/storageAccounts",
270- "apiVersion": "2019-06 -01",
283+ "apiVersion": "2022-09 -01",
271284 "name": "[variables('storageAccountName')]",
272- "location": "[resourceGroup(). location]",
285+ "location": "[parameters(' location') ]",
273286 "sku": {
274- "name": "Standard_LRS",
275- "tier": "Standard"
287+ "name": "Standard_LRS"
276288 },
277289 "kind": "StorageV2",
278290 "properties": {
@@ -281,20 +293,17 @@ The following ARM template creates a container instance and a file share, and th
281293 },
282294 {
283295 "type": "Microsoft.Storage/storageAccounts/fileServices/shares",
284- "apiVersion": "2019-06 -01",
285- "name": "[concat(variables('storageAccountName'), '/default/' , variables('fileShareName'))]",
296+ "apiVersion": "2022-09 -01",
297+ "name": "[format('{0}/default/{1}', variables('storageAccountName') , variables('fileShareName'))]",
286298 "dependsOn": [
287299 "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
288300 ]
289301 },
290302 {
291303 "type": "Microsoft.ContainerInstance/containerGroups",
292- "apiVersion": "2019-12 -01",
304+ "apiVersion": "2023-05 -01",
293305 "name": "[variables('containerGroupName')]",
294- "location": "[resourceGroup().location]",
295- "dependsOn": [
296- "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
297- ],
306+ "location": "[parameters('location')]",
298307 "properties": {
299308 "containers": [
300309 {
@@ -304,7 +313,7 @@ The following ARM template creates a container instance and a file share, and th
304313 "resources": {
305314 "requests": {
306315 "cpu": 1,
307- "memoryInGb ": 1.5
316+ "memoryInGB ": "[json(' 1.5')]"
308317 }
309318 },
310319 "ports": [
@@ -335,11 +344,14 @@ The following ARM template creates a container instance and a file share, and th
335344 "readOnly": false,
336345 "shareName": "[variables('fileShareName')]",
337346 "storageAccountName": "[variables('storageAccountName')]",
338- "storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06 -01').keys[0].value]"
347+ "storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2022-09 -01').keys[0].value]"
339348 }
340349 }
341350 ]
342- }
351+ },
352+ "dependsOn": [
353+ "storageAccount"
354+ ]
343355 }
344356 ]
345357}
0 commit comments