You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for creating the validation tool.
I have found that there are 2 edge cases in Parameter-Types-Should-Be-Consistent where we are not getting the expected behavior:
1. Nested deployment output of type int -> nested deployment input of type string should fail
$ pwsh --Command 'Import-Module .\arm-ttk\arm-ttk.psd1 -Force; ./unit-tests/Parameter-Types-Should-Be-Consistent/Parameter-Types-Should-Be-Consistent.tests.ps1'
Describing Parameter-Types-Should-Be-Consistent
Context Fail
[+] Validates grandchild is flagged 1.09s
[+] Validates InconsistentParameterTypes is flagged 65ms
[-] Validates InconsistentParameterTypesOutput is flagged 100ms
RuntimeException: Errors were expected
at <ScriptBlock>, /home/nagyako/arm-ttk/arm-ttk/unit-tests/arm-ttk.test.functions.ps1: line 131
The deployment fails with the below error:
"Deployment template validation failed: 'Template parameter 'parameter1' was provided an invalid value. Expected a value of type 'String, Uri', but received a value of type 'Integer'. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.
2. Nested deployment output of type array -> nested deployment input of type array should pass
Context Pass
[+] Validates ConsistentParameterTypes is correct 61ms
[-] Validates ConsistentParameterTypesOutput is correct 578ms
RuntimeException: Write-Error: /home/nagyako/arm-ttk/arm-ttk/arm-ttk/Test-AzTemplate.ps1:253
Line |
253 |.$myModule$TheTest @testInput 2>&13>&1|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Type Mismatch: Parameter 'deploymentNames'in nested template '[format('{0}nestedDeployment2', parameters('project'))]' is defined as array, but the parent template defines it as string).
at <ScriptBlock>, /home/nagyako/arm-ttk/arm-ttk/unit-tests/arm-ttk.test.functions.ps1: line 96
[+] Validates grandchild is correct 77ms
The second template was generated from bicep and works fine:
If the referenced resource name is literal and does not contain a parameter like format('{0}nestedDeployment1', parameters('project')) then the test is passing.
The text was updated successfully, but these errors were encountered:
Hi All,
Thanks for creating the validation tool.
I have found that there are 2 edge cases in Parameter-Types-Should-Be-Consistent where we are not getting the expected behavior:
1. Nested deployment output of type int -> nested deployment input of type string should fail
Template:
Test results:
The deployment fails with the below error:
"Deployment template validation failed: 'Template parameter 'parameter1' was provided an invalid value. Expected a value of type 'String, Uri', but received a value of type 'Integer'. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.
2. Nested deployment output of type array -> nested deployment input of type array should pass
Template:
Test results:
The second template was generated from bicep and works fine:
If the referenced resource name is literal and does not contain a parameter like
format('{0}nestedDeployment1', parameters('project'))
then the test is passing.The text was updated successfully, but these errors were encountered: