Skip to content

Commit 5bc1ba3

Browse files
committed
update
1 parent e3cd5fe commit 5bc1ba3

File tree

1 file changed

+56
-60
lines changed

1 file changed

+56
-60
lines changed

articles/azure-resource-manager/templates/quickstart-create-template-specs.md

Lines changed: 56 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ The template spec is a resource type named `Microsoft.Resources/templateSpecs`.
137137
# [ARM Template](#tab/azure-resource-manager)
138138
139139
> [!NOTE]
140-
> Instead of using an ARM template, we recommend that you use PowerShell or CLI to create your template spec. Those tools automatically convert linked templates to artifacts connected to your main template. When you use an ARM template to create the template spec, you must manually add those linked templates as artifacts, which can be complicated.
140+
> We recommend using PowerShell or CLI instead of an ARM template to create your template spec. These tools automatically convert linked templates into artifacts associated with the main template. If you use an ARM template, you'll need to manually add linked templates as artifacts, which can be more complex.
141141
142142
1. When you use an ARM template to create the template spec, the template is embedded in the resource definition. Copy the following template and save it locally as **createTemplateSpec.json**.
143143
144144
> [!NOTE]
145-
> In the embedded template, all [template expressions](template-expressions.md) must be escaped with a second left bracket. Use `"[[` instead of `"[`. JSON arrays still use a single left bracket.
145+
> In the embedded template, all [template expressions](template-expressions.md) must be escaped with a second left bracket. Use `"[[` instead of `"[`. JSON arrays still use a single left bracket. See the **name** and **location** properties in the example below.
146146
147147
```json
148148
{
@@ -165,35 +165,33 @@ The template spec is a resource type named `Microsoft.Resources/templateSpecs`.
165165
"location": "westus2",
166166
"properties": {
167167
"mainTemplate": {
168-
{
169-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
170-
"contentVersion": "1.0.0.0",
171-
"parameters": {
172-
"storageAccountName": {
173-
"type": "string",
174-
"defaultValue": "[uniqueString(resourceGroup().id)]"
175-
},
176-
"location": {
177-
"type": "string",
178-
"defaultValue": "[resourceGroup().location]"
179-
}
168+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
169+
"contentVersion": "1.0.0.0",
170+
"parameters": {
171+
"storageAccountName": {
172+
"type": "string",
173+
"defaultValue": "[uniqueString(resourceGroup().id)]"
180174
},
181-
"resources": [
182-
{
183-
"type": "Microsoft.Storage/storageAccounts",
184-
"apiVersion": "2025-01-01",
185-
"name": "[parameters('storageAccountName')]",
186-
"location": "[parameters('location')]",
187-
"sku": {
188-
"name": "Standard_LRS"
189-
},
190-
"kind": "StorageV2",
191-
"properties": {
192-
"accessTier": "Hot"
193-
}
175+
"location": {
176+
"type": "string",
177+
"defaultValue": "[resourceGroup().location]"
178+
}
179+
},
180+
"resources": [
181+
{
182+
"type": "Microsoft.Storage/storageAccounts",
183+
"apiVersion": "2025-01-01",
184+
"name": "[[parameters('storageAccountName')]",
185+
"location": "[[parameters('location')]",
186+
"sku": {
187+
"name": "Standard_LRS"
188+
},
189+
"kind": "StorageV2",
190+
"properties": {
191+
"accessTier": "Hot"
194192
}
195-
]
196-
}
193+
}
194+
]
197195
}
198196
},
199197
"dependsOn": [
@@ -328,7 +326,7 @@ To deploy a template spec, use the same deployment commands as you would use to
328326
329327
# [ARM Template](#tab/azure-resource-manager)
330328
331-
1. Copy the following template and save it locally to a file named **storage.json**.
329+
1. Copy the following template and save it locally to a file named **deployTemplateSpec.json**.
332330
333331
```json
334332
{
@@ -373,13 +371,13 @@ To deploy a template spec, use the same deployment commands as you would use to
373371
```azurepowershell
374372
New-AzResourceGroupDeployment `
375373
-ResourceGroupName storageRG `
376-
-TemplateFile "C:\Templates\storage.json"
374+
-TemplateFile "C:\Templates\deployTemplateSpec.json"
377375
```
378376
379377
```azurecli
380378
az deployment group create \
381379
--resource-group storageRG \
382-
--template-file "C:\Templates\storage.json"
380+
--template-file "C:\Templates\deployTemplateSpec.json"
383381
```
384382
385383
---
@@ -530,39 +528,37 @@ Instead of creating a new template spec for the revised template, add a new vers
530528
{
531529
"type": "Microsoft.Resources/templateSpecs/versions",
532530
"apiVersion": "2022-02-01",
533-
"name": "[format('{0}/{1}', 'storageSpec', '1.0')]",
531+
"name": "[format('{0}/{1}', 'storageSpec', '2.0')]",
534532
"location": "westus2",
535533
"properties": {
536534
"mainTemplate": {
537-
{
538-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
539-
"contentVersion": "1.0.0.0",
540-
"parameters": {
541-
"storageAccountName": {
542-
"type": "string",
543-
"defaultValue": "[format('store{0}', uniqueString(resourceGroup().id))]",
544-
},
545-
"location": {
546-
"type": "string",
547-
"defaultValue": "[resourceGroup().location]"
548-
}
535+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
536+
"contentVersion": "1.0.0.0",
537+
"parameters": {
538+
"storageAccountName": {
539+
"type": "string",
540+
"defaultValue": "[format('store{0}', uniqueString(resourceGroup().id))]"
549541
},
550-
"resources": [
551-
{
552-
"type": "Microsoft.Storage/storageAccounts",
553-
"apiVersion": "2025-01-01",
554-
"name": "[parameters('storageAccountName')]",
555-
"location": "[parameters('location')]",
556-
"sku": {
557-
"name": "Standard_LRS"
558-
},
559-
"kind": "StorageV2",
560-
"properties": {
561-
"accessTier": "Hot"
562-
}
542+
"location": {
543+
"type": "string",
544+
"defaultValue": "[resourceGroup().location]"
545+
}
546+
},
547+
"resources": [
548+
{
549+
"type": "Microsoft.Storage/storageAccounts",
550+
"apiVersion": "2025-01-01",
551+
"name": "[[parameters('storageAccountName')]",
552+
"location": "[[parameters('location')]",
553+
"sku": {
554+
"name": "Standard_LRS"
555+
},
556+
"kind": "StorageV2",
557+
"properties": {
558+
"accessTier": "Hot"
563559
}
564-
]
565-
}
560+
}
561+
]
566562
}
567563
},
568564
"dependsOn": [

0 commit comments

Comments
 (0)