Skip to content

Commit 67fe3d5

Browse files
committed
update the template spec article
1 parent fe6d9f9 commit 67fe3d5

File tree

1 file changed

+58
-64
lines changed

1 file changed

+58
-64
lines changed

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

Lines changed: 58 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create and deploy template spec
33
description: Learn how to create a template spec from ARM template. Then, deploy the template spec to a resource group in your subscription.
4-
ms.date: 01/29/2025
4+
ms.date: 07/24/2025
55
ms.topic: quickstart
66
ms.custom: mode-api, devx-track-azurecli, devx-track-arm-template
77
ms.devlang: azurecli
@@ -118,82 +118,76 @@ The template spec is a resource type named `Microsoft.Resources/templateSpecs`.
118118
{
119119
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
120120
"contentVersion": "1.0.0.0",
121-
"parameters": {},
122-
"functions": [],
123-
"variables": {},
124121
"resources": [
125122
{
126123
"type": "Microsoft.Resources/templateSpecs",
127-
"apiVersion": "2021-05-01",
124+
"apiVersion": "2022-02-01",
128125
"name": "storageSpec",
129126
"location": "westus2",
130127
"properties": {
131128
"displayName": "Storage template spec"
132-
},
133-
"tags": {},
134-
"resources": [
135-
{
136-
"type": "versions",
137-
"apiVersion": "2021-05-01",
138-
"name": "1.0",
139-
"location": "westus2",
140-
"dependsOn": [ "storageSpec" ],
141-
"properties": {
142-
"mainTemplate": {
143-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
144-
"contentVersion": "1.0.0.0",
145-
"parameters": {
146-
"storageAccountType": {
147-
"type": "string",
148-
"defaultValue": "Standard_LRS",
149-
"allowedValues": [
150-
"Standard_LRS",
151-
"Standard_GRS",
152-
"Standard_ZRS",
153-
"Premium_LRS"
154-
],
155-
"metadata": {
156-
"description": "Storage Account type"
157-
}
158-
},
159-
"location": {
160-
"type": "string",
161-
"defaultValue": "[[resourceGroup().location]",
162-
"metadata": {
163-
"description": "Location for all resources."
164-
}
165-
}
166-
},
167-
"variables": {
168-
"storageAccountName": "[[concat('store', uniquestring(resourceGroup().id))]"
169-
},
170-
"resources": [
171-
{
172-
"type": "Microsoft.Storage/storageAccounts",
173-
"apiVersion": "2022-09-01",
174-
"name": "[[variables('storageAccountName')]",
175-
"location": "[[parameters('location')]",
176-
"sku": {
177-
"name": "[[parameters('storageAccountType')]"
178-
},
179-
"kind": "StorageV2",
180-
"properties": {}
181-
}
129+
}
130+
},
131+
{
132+
"type": "Microsoft.Resources/templateSpecs/versions",
133+
"apiVersion": "2022-02-01",
134+
"name": "[format('{0}/{1}', 'storageSpec', '1.0')]",
135+
"location": "westus2",
136+
"properties": {
137+
"mainTemplate": {
138+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
139+
"contentVersion": "1.0.0.0",
140+
"parameters": {
141+
"storageAccountType": {
142+
"type": "string",
143+
"defaultValue": "Standard_LRS",
144+
"allowedValues": [
145+
"Standard_LRS",
146+
"Standard_GRS",
147+
"Standard_ZRS",
148+
"Premium_LRS"
182149
],
183-
"outputs": {
184-
"storageAccountName": {
185-
"type": "string",
186-
"value": "[[variables('storageAccountName')]"
187-
}
150+
"metadata": {
151+
"description": "Storage Account type"
152+
}
153+
},
154+
"location": {
155+
"type": "string",
156+
"defaultValue": "[[resourceGroup().location]",
157+
"metadata": {
158+
"description": "Location for all resources."
188159
}
189160
}
190161
},
191-
"tags": {}
162+
"variables": {
163+
"storageAccountName": "[[concat('store', uniquestring(resourceGroup().id))]"
164+
},
165+
"resources": [
166+
{
167+
"type": "Microsoft.Storage/storageAccounts",
168+
"apiVersion": "2022-09-01",
169+
"name": "[[variables('storageAccountName')]",
170+
"location": "[[parameters('location')]",
171+
"sku": {
172+
"name": "[[parameters('storageAccountType')]"
173+
},
174+
"kind": "StorageV2",
175+
"properties": {}
176+
}
177+
],
178+
"outputs": {
179+
"storageAccountName": {
180+
"type": "string",
181+
"value": "[[variables('storageAccountName')]"
182+
}
183+
}
192184
}
185+
},
186+
"dependsOn": [
187+
"storageSpec"
193188
]
194189
}
195-
],
196-
"outputs": {}
190+
]
197191
}
198192
```
199193
@@ -333,7 +327,7 @@ To deploy a template spec, use the same deployment commands as you would use to
333327
"resources": [
334328
{
335329
"type": "Microsoft.Resources/deployments",
336-
"apiVersion": "2021-04-01",
330+
"apiVersion": "2025-04-01",
337331
"name": "demo",
338332
"properties": {
339333
"templateLink": {

0 commit comments

Comments
 (0)