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
I created a repro for the problem about a false positive triggering The _artifactsLocation and _artifactsLocationSasToken parameters must not have a defaultValue in a nested template problem
The ARM TTK is used by Azure Marketplace for manual validation of submitted managed applications. Unfortunately, ARM TTK complains about a problem related to the _artifactsLocation and _artifactsLocationSasToken parameters.
In this repro, we compile a set of Bicep sources into an ARM JSON, which we validate using ARM TTK.
In mainTemplate.bicep, these 2 parameters either have default values,
we're getting a confusing error message, which says that in a nested template, there must be no default values. However, the nested template has no default values:
Validating ARM-JSON\mainTemplate.json
artifacts parameter
[-] artifacts parameter (86 ms)
The _artifactsLocation and _artifactsLocationSasToken parameters in "mainTemplate.json"
must not have a defaulValue in a nested template.
But ARM TTK artifacts-parameter.test.ps1 triggers the error. It seems the $IsMainTemplate isn't properly being passed down to the artifacts-parameter.test.ps1 script; it's false for the mainTemplate.json file...
When removing the defaults in the main template
When removing the defaults for _artifactsLocation and _artifactsLocationSasToken in the main template, ARM TTK stops complaining about mainTemplate.json and starts complaining about createUiDefinition.json...
Validating ARM-JSON\createUiDefinition.json
Parameters Without Default Must Exist In CreateUIDefinition
[-] Parameters Without Default Must Exist In CreateUIDefinition (67 ms)
_artifactsLocation does not have a default value, and is not defined in CreateUIDefinition.outputs
_artifactsLocationSasToken does not have a default value, and is not defined in CreateUIDefinition.outputs
The text was updated successfully, but these errors were encountered:
I created a repro for the problem about a false positive triggering
The _artifactsLocation and _artifactsLocationSasToken parameters must not have a defaultValue in a nested template
problemRepro: https://github.com/chgeuer/repro_arm_ttk_artifactslocationproblem
The ARM TTK is used by Azure Marketplace for manual validation of submitted managed applications. Unfortunately, ARM TTK complains about a problem related to the
_artifactsLocation
and_artifactsLocationSasToken
parameters.In this repro, we compile a set of Bicep sources into an ARM JSON, which we validate using ARM TTK.
In
mainTemplate.bicep
, these 2 parameters either have default values,or don't:
Subsequently, we passe these values down to a nested template (please note that I renamed the receiving parameters to avoid confusion):
Note that in the nested template, the
artifactsLocation
andartifactsLocationSasToken
parameters have no default values at all.When using default values in the main template
When supplying default values in the main template,
we're getting a confusing error message, which says that in a nested template, there must be no default values. However, the nested template has no default values:
However, looking at the samples (https://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/best-practices.md#deployment-artifacts-nested-templates-scripts), this seems to be the correct way.
But ARM TTK artifacts-parameter.test.ps1 triggers the error. It seems the
$IsMainTemplate
isn't properly being passed down to theartifacts-parameter.test.ps1
script; it'sfalse
for themainTemplate.json
file...When removing the defaults in the main template
When removing the defaults for
_artifactsLocation
and_artifactsLocationSasToken
in the main template, ARM TTK stops complaining aboutmainTemplate.json
and starts complaining aboutcreateUiDefinition.json
...The text was updated successfully, but these errors were encountered: