Suggestion: Update validation text (amazing feature that looks like an issue)
See original GitHub issueWhat I originally thought was an issue …
When creating an ARM template and adding a parameter, in this case following a docs tutorial, I see a perplexing validation issue:
It appears that the minLength field on a parameter is triggering the “must be greater or equal to 3” validation when it is set to exactly 3.
It looks like either the validation rule itself needs to be updated, or the text of the validation should be updated to reflect that it must be greater than 3.
…turned out to be an awesome feature…
It turns out, this was the tooling being really helpful. I had generated a parameters file, but had not yet filled it out. As such, the template itself showed an error. Which is an amazing holistic way to think about templates and really helpful.
…only I couldn’t tell it was a feature.
I am reasonably new to the ARM template tooling in VS code so maybe this is just a newcomer’s issue. The error message reads:
Template validation failed: The provided value for the template parameter ‘storageAccountName’ at line ‘10’ and column ‘26’ is not valid. Length of the value should be greater than or equal to ‘4’. Please see https://aka.ms/arm-template/#parameters for usage details.arm-template (validation)
Upon close inspection, this could make sense. It’s the value for the parameter, not the minLength itself. However, line 10 and column 26 reference where that value is, and since I’m in the context of the ARM template file, I assume the validation issue that’s discovered must be within that context, not another context in a separate file.
Potential suggestions to help
A few things I think could help alleviate this – if there’s any low-hanging fruit there, might make sense to take it up.
- If it would be possible, reference the parameter json filename – that would have been a really helpful clue in this instance,
- Move (or at least add) this validation to the parameter json file, which will make it very clear when I flip over to that file that it’s the issue.
- In the validation, provide the supplied value, e.g.
Parameter value retrieved: "". This would clearly indicate to the user what the validation is seeing, which could have also allowed me to quickly understand the discrepancy. - Update the error message language: perhaps instead of
The provided value for the template parameter 'storageAccountName', the phrasing could beThe retrieved value for the template parameter 'storageAccountName'. By usingretrieved, that quickly tells me that the parameter is coming from somewhere else.Providedmakes me look at the value that exists on that line. - Instead of
Template validation failed, perhaps these validations could read “Parameter retrieval failed” or “Parameter application failed” or “Parameter value validation failed”.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)


Top Related StackOverflow Question
@neilpeterson to start a conversion with ARM team.
The story of our profession. 😆 Thanks for looking into it!