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

define: naming for azure.yaml services #4400

Open
weikanglim opened this issue Oct 2, 2024 · 1 comment
Open

define: naming for azure.yaml services #4400

weikanglim opened this issue Oct 2, 2024 · 1 comment
Assignees
Milestone

Comments

@weikanglim
Copy link
Contributor

In future azd features, azd will start using the names of services (or elements in azure.yaml) as command targets.

It's important for us to think about what allowed naming characters we should allow. For example, if we allow . characters (which currently breaks parts of azd today -- such as in #3183), we'd have to think about if we ever use . as a property accessor. Example: myapp.api.env would end up being ambiguous for interpretation without escaping.

Early design ideas

We have some prior-art for inspiration from DNS systems, which also influences K8s object names:

DNS Subdomain Names RFC 1123

  1. contain no more than 253 characters
  2. contain only lowercase alphanumeric characters, '-' or '.'
  3. start with an alphanumeric character
  4. end with an alphanumeric character

RFC 1123 Label Names - RFC 1123.

  1. contain at most 63 characters
  2. contain only lowercase alphanumeric characters or '-'
  3. start with an alphanumeric character
  4. end with an alphanumeric character

RFC 1035 Label Names - RFC 1035.

  1. contain at most 63 characters
  2. contain only lowercase alphanumeric characters or '-'
  3. start with an alphabetic character
  4. end with an alphanumeric character

From how azd is commonly used today, we seem to lean towards RFC 1123 label names -- lowercase, dash-separated, alphanumeric characters.

Use cases to consider

The main question to consider is that whether all language developers will overall be comfortable with whatever naming scheme we choose.

I'm opening up this issue for discussion, hoping we can arrive at some level of consensus. The next phase of implementation is likely to implement the naming scheme as a recommendation in the short/near term, and eventually as a restriction in the longer term.

@weikanglim
Copy link
Contributor Author

With #4403, I'm adding logic for default name generation in azd-init to match RFC 1123 label names as a point of experimentation and gathering user feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant