question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion: Update validation text (amazing feature that looks like an issue)

See original GitHub issue

What 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:

image

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 be The retrieved value for the template parameter 'storageAccountName'. By using retrieved, that quickly tells me that the parameter is coming from somewhere else. Provided makes 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
StephenWeatherfordcommented, Aug 6, 2020

@neilpeterson to start a conversion with ARM team.

1reaction
SeanKilleencommented, Jul 29, 2020

Unfortunately it’s not quite that simple

The story of our profession. 😆 Thanks for looking into it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web Form Validation: Best Practices and Tutorials
The goal of web form validation is to ensure that the user provided necessary and properly formatted information needed to successfully ...
Read more >
Stuck on Trailhead Challenge for Unit 3/3 Validation Formulas
The part I am stuck on is if the "Contact records with no associated parent account can be added with any MaiilingPostalCode value"......
Read more >
Error Messages: Examples, Best Practices & Common Mistakes
Useful error messages can keep users on your site and increase conversions. See examples and learn the best practices.
Read more >
Feature suggestion: validation in Component Output node
My suggestion is to allow validation logic to be placed in the Component Output node. This way, when the user selects the “Next”...
Read more >
Form Validation UX in HTML and CSS
Just that alone is a UX consideration all too many forms fail on. Placeholders are suggestions for valid input, like putting “Tulsa” in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found