Skip to content

Commit a428d2a

Browse files
bmoore-msftazure-quickstart-templates pipeline
andauthored
prototype skip (#687)
Co-authored-by: azure-quickstart-templates pipeline <azure-quickstart-templates@noreply.github.com>
1 parent c580703 commit a428d2a

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

arm-ttk/testcases/deploymentTemplate/apiVersions-Should-Be-Recent.test.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ foreach ($av in $allApiVersions) {
7171
continue
7272
}
7373

74+
# skip checking this resource only, if metadata array contains the disable directive
75+
if ($av.metadata -contains 'disable-apiVersions-should-be-recent'){
76+
Write-Warning "Skipping check on $($av.type)/$($av.name) with apiVersion: $($av.apiVersion)"
77+
continue
78+
}
79+
7480
# Then walk over each object containing an ApiVersion.
7581
if ($av.ApiVersion -isnot [string]) {
7682
# If the APIVersion is not a string
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {},
5+
"functions": [],
6+
"variables": {},
7+
"resources": [
8+
{
9+
"metadata": ["disable-apiVersions-should-be-recent"],
10+
"name": "publicIPAddress1",
11+
"type": "Microsoft.Network/publicIPAddresses",
12+
"apiVersion": "2015-06-15",
13+
"location": "[resourceGroup().location]",
14+
"tags": {
15+
"displayName": "publicIPAddress1"
16+
},
17+
"properties": {
18+
"publicIPAllocationMethod": "Dynamic"
19+
}
20+
}
21+
],
22+
"outputs": {}
23+
}

0 commit comments

Comments
 (0)