@@ -3,7 +3,7 @@ title: Template test cases for test toolkit
3
3
description : Describes the template tests that are run by the Azure Resource Manager template test toolkit.
4
4
ms.topic : conceptual
5
5
ms.custom : devx-track-arm-template
6
- ms.date : 04/28 /2025
6
+ ms.date : 07/23 /2025
7
7
---
8
8
9
9
# Test cases for ARM templates
@@ -178,13 +178,12 @@ The following example **fails** because the resource's `location` is set to `res
178
178
"resources" : [
179
179
{
180
180
"type" : " Microsoft.Storage/storageAccounts" ,
181
- "apiVersion" : " 2021-02 -01" ,
181
+ "apiVersion" : " 2025-01 -01" ,
182
182
"name" : " storageaccount1" ,
183
183
"location" : " [resourceGroup().location]" ,
184
184
"kind" : " StorageV2" ,
185
185
"sku" : {
186
186
"name" : " Premium_LRS" ,
187
- "tier" : " Premium"
188
187
}
189
188
}
190
189
]
@@ -207,13 +206,12 @@ The next example uses a `location` parameter but **fails** because the parameter
207
206
"resources" : [
208
207
{
209
208
"type" : " Microsoft.Storage/storageAccounts" ,
210
- "apiVersion" : " 2021-02 -01" ,
209
+ "apiVersion" : " 2025-01 -01" ,
211
210
"name" : " storageaccount1" ,
212
211
"location" : " [parameters('location')]" ,
213
212
"kind" : " StorageV2" ,
214
213
"sku" : {
215
214
"name" : " Premium_LRS" ,
216
- "tier" : " Premium"
217
215
}
218
216
}
219
217
],
@@ -240,13 +238,12 @@ The following example **passes** when the template is used as the main template.
240
238
"resources" : [
241
239
{
242
240
"type" : " Microsoft.Storage/storageAccounts" ,
243
- "apiVersion" : " 2021-02 -01" ,
241
+ "apiVersion" : " 2025-01 -01" ,
244
242
"name" : " storageaccount1" ,
245
243
"location" : " [parameters('location')]" ,
246
244
"kind" : " StorageV2" ,
247
245
"sku" : {
248
246
"name" : " Premium_LRS" ,
249
- "tier" : " Premium"
250
247
}
251
248
}
252
249
],
@@ -277,13 +274,12 @@ The following example **fails** because the `location` isn't an expression or `g
277
274
"resources" : [
278
275
{
279
276
"type" : " Microsoft.Storage/storageAccounts" ,
280
- "apiVersion" : " 2021-02 -01" ,
277
+ "apiVersion" : " 2025-01 -01" ,
281
278
"name" : " storageaccount1" ,
282
279
"location" : " westus" ,
283
280
"kind" : " StorageV2" ,
284
281
"sku" : {
285
282
"name" : " Premium_LRS" ,
286
- "tier" : " Premium"
287
283
}
288
284
}
289
285
],
@@ -303,13 +299,12 @@ The following example **passes** because the resource `location` is set to `glob
303
299
"resources" : [
304
300
{
305
301
"type" : " Microsoft.Storage/storageAccounts" ,
306
- "apiVersion" : " 2021-02 -01" ,
302
+ "apiVersion" : " 2025-01 -01" ,
307
303
"name" : " storageaccount1" ,
308
304
"location" : " global" ,
309
305
"kind" : " StorageV2" ,
310
306
"sku" : {
311
307
"name" : " Premium_LRS" ,
312
- "tier" : " Premium"
313
308
}
314
309
}
315
310
],
@@ -337,13 +332,12 @@ The next example also **passes** because the `location` parameter uses an expres
337
332
"resources" : [
338
333
{
339
334
"type" : " Microsoft.Storage/storageAccounts" ,
340
- "apiVersion" : " 2021-02 -01" ,
335
+ "apiVersion" : " 2025-01 -01" ,
341
336
"name" : " storageaccount1" ,
342
337
"location" : " [parameters('location')]" ,
343
338
"kind" : " StorageV2" ,
344
339
"sku" : {
345
340
"name" : " Premium_LRS" ,
346
- "tier" : " Premium"
347
341
}
348
342
}
349
343
],
@@ -363,7 +357,7 @@ The following example **fails** because the `hardwareProfile` object's `vmSize`
363
357
"resources" : [
364
358
{
365
359
"type" : " Microsoft.Compute/virtualMachines" ,
366
- "apiVersion" : " 2020-12 -01" ,
360
+ "apiVersion" : " 2024-11 -01" ,
367
361
"name" : " demoVM" ,
368
362
"location" : " [parameters('location')]" ,
369
363
"properties" : {
@@ -395,7 +389,7 @@ Then, `hardwareProfile` uses an expression for `vmSize` to reference the paramet
395
389
"resources" : [
396
390
{
397
391
"type" : " Microsoft.Compute/virtualMachines" ,
398
- "apiVersion" : " 2020-12 -01" ,
392
+ "apiVersion" : " 2024-11 -01" ,
399
393
"name" : " demoVM" ,
400
394
"location" : " [parameters('location')]" ,
401
395
"properties" : {
@@ -634,7 +628,7 @@ The following example **passes** because it's a recent version that's not a prev
634
628
"resources" : [
635
629
{
636
630
"type" : " Microsoft.Storage/storageAccounts" ,
637
- "apiVersion" : " 2021-02 -01" ,
631
+ "apiVersion" : " 2025-01 -01" ,
638
632
"name" : " storageaccount1" ,
639
633
"location" : " [parameters('location')]"
640
634
}
@@ -665,7 +659,7 @@ The following example **passes**.
665
659
"resources" : [
666
660
{
667
661
"type" : " Microsoft.Compute/virtualMachines" ,
668
- "apiVersion" : " 2020-12 -01" ,
662
+ "apiVersion" : " 2024-11 -01" ,
669
663
...
670
664
}
671
665
]
@@ -685,7 +679,7 @@ The following example **fails** because there are empty properties.
685
679
"resources" : [
686
680
{
687
681
"type" : " Microsoft.Storage/storageAccounts" ,
688
- "apiVersion" : " 2021 -01-01" ,
682
+ "apiVersion" : " 2025 -01-01" ,
689
683
"name" : " storageaccount1" ,
690
684
"location" : " [parameters('location')]" ,
691
685
"sku" : {},
@@ -700,12 +694,11 @@ The following example **passes** because the properties include values.
700
694
"resources" : [
701
695
{
702
696
"type" : " Microsoft.Storage/storageAccounts" ,
703
- "apiVersion" : " 2021 -01-01" ,
697
+ "apiVersion" : " 2025 -01-01" ,
704
698
"name" : " storageaccount1" ,
705
699
"location" : " [parameters('location')]" ,
706
700
"sku" : {
707
701
"name" : " Standard_LRS" ,
708
- "tier" : " Standard"
709
702
},
710
703
"kind" : " Storage"
711
704
}
@@ -739,7 +732,7 @@ The next example **passes**.
739
732
740
733
``` json
741
734
"networkSecurityGroup" : {
742
- "id" : " [resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
735
+ "id" : " [resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
743
736
}
744
737
```
745
738
@@ -753,15 +746,15 @@ The following example **fails** because you don't need to provide the current su
753
746
754
747
``` json
755
748
"networkSecurityGroup" : {
756
- "id" : " [resourceId(subscription().subscriptionId, resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
749
+ "id" : " [resourceId(subscription().subscriptionId, resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
757
750
}
758
751
```
759
752
760
753
The next example ** passes** .
761
754
762
755
``` json
763
756
"networkSecurityGroup" : {
764
- "id" : " [resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
757
+ "id" : " [resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
765
758
}
766
759
```
767
760
0 commit comments