Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation attribute - lowercase #9970

Closed
dazinator opened this issue Mar 1, 2023 · 2 comments
Closed

validation attribute - lowercase #9970

dazinator opened this issue Mar 1, 2023 · 2 comments
Labels
enhancement New feature or request Needs: Triage 🔍

Comments

@dazinator
Copy link

dazinator commented Mar 1, 2023

Is your feature request related to a problem? Please describe.
Azure storage accounts must be created with an account name that is

  • lower case letters and numbers
  • min length 3
  • max length 24

Where storageAccountName is a parameter of a bicep deployment, it would seem prudent to validate the param in line with azure's own requirements.

We can currently validate using min and max length, however it seems we are missing the ability to validate:

  • lower case letters and numbers?

Describe the solution you'd like
Make it easy to fulfil the above validation requirement. For example via new validation attributes e.g @alphaNumeric() or perhaps a more flexible regex validation, or even allow custom validation attributes somehow.

@dazinator dazinator added the enhancement New feature or request label Mar 1, 2023
@ghost ghost added the Needs: Triage 🔍 label Mar 1, 2023
@alex-frankel
Copy link
Collaborator

Dup of #1679

@dazinator
Copy link
Author

@alex-frankel not sure if the issue linked as dupe covers the same ground. It reads to me as its asking for bicep to validate the name property of various resources according to rules. However suppose you have a bicep module that accepts the name as a bicep parameter. Then in main.bicep you consume that module, what validation is there of that bicep parameter? As the module author you'd want to add validation to that bicep paramater to align with its intended purpose - i.e being used to set the name of some resources which have particular rules. Can you confirm whether the issue linked as dupe will also cover this scenario?

@ghost ghost locked as resolved and limited conversation to collaborators May 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

2 participants