diff --git a/arm-ttk/testcases/deploymentTemplate/apiVersions-Should-Be-Recent-In-Reference-Functions.test.ps1 b/arm-ttk/testcases/deploymentTemplate/apiVersions-Should-Be-Recent-In-Reference-Functions.test.ps1 index 64eb8090..2a245e5e 100644 --- a/arm-ttk/testcases/deploymentTemplate/apiVersions-Should-Be-Recent-In-Reference-Functions.test.ps1 +++ b/arm-ttk/testcases/deploymentTemplate/apiVersions-Should-Be-Recent-In-Reference-Functions.test.ps1 @@ -28,9 +28,18 @@ param( # Test Run Date - date to use when doing comparisons, if not current date (used for unit testing against and old cache) [Parameter(Mandatory = $false, Position = 3)] [datetime] - $TestDate = [DateTime]::Now + $TestDate = [DateTime]::Now, + + [Parameter(Mandatory = $true)] + [PSCustomObject] + $TemplateMetadata ) + # bicep - if this is a bicep file, skip since the apiVersions are implicit (most of the time) + if( $TemplateMetadata._generator.name -eq 'bicep') { + continue + } + $foundReferences = $TemplateText | ? -FunctionName 'reference|list\w{0,}' diff --git a/unit-tests/apiVersions-Should-Be-Recent-In-Reference-Functions/Pass/bicep.json b/unit-tests/apiVersions-Should-Be-Recent-In-Reference-Functions/Pass/bicep.json new file mode 100644 index 00000000..0804a239 --- /dev/null +++ b/unit-tests/apiVersions-Should-Be-Recent-In-Reference-Functions/Pass/bicep.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.5.6.12127", + "templateHash": "16815708176905569328" + } + }, + "parameters": {}, + "functions": [], + "variables": {}, + "resources": [], + "outputs": { + "oldIPReference": "[reference(resourceId('Microsoft.Network/publicIPAddresses', 'test'), '2015-06-15', 'Full')]" + } +} \ No newline at end of file