mspnp / AzureNamingTool

The Azure Naming Tool is a .NET 8 Blazor application, with a RESTful API. The UI consists of several pages to allow the configuration and generation of Azure Resource names. The API provides a programmatic interface for the functionality.
https://aka.ms/azurenamingtool
MIT License
308 stars 604 forks source link

Double delimiter when no optional component #39

Closed koalajama closed 7 months ago

koalajama commented 8 months ago

Tool version 3.1.1

Describe the bug When not populating an optional component, two delimiters are present in the generated name instead of one.

To Reproduce Steps to reproduce the behavior: I have two custom components added to my name.

  1. Parent Resource (Optional) - Open ended text

  2. Resource Name - Open ended text

  3. Go to Generate

  4. Choose item and populate all fields, except optional.

  5. Click Generate

  6. See that output has two delimiters where the optional component would be, had it been populated.

Expected behavior I would expect the system to recognize I did not populate the optional field, and only insert one delimiter.

Screenshots If applicable, add screenshots to help explain your problem. CustomComponent GeneratedName

Installation Method FTP upload to Azure Web app

BryanSoltis commented 8 months ago

Hi @koalajama,

Thank you for your feedback. In looking at the screenshot, it seems as if your "Parent Resource" has a blank value (which I'm not sure how that is even possible. Because of that, the tool is interpreting the "blank" in the name as a valid value, therefore it is wrapping it with the delimiter. When entering a component option, a name/short is required, so I'm not sure how it allowed that as an option.

If possible, can you export your "Parent Resource" config and provide it here? Be sure to remove any sensitive information before posting.

Thank you!

-Bryan

BryanSoltis commented 8 months ago

CORRECTION - I see that the field is an "Open text" type, which explains the blank value. I will continue to research.

-Bryan

BryanSoltis commented 8 months ago

OK, I found the issue in the Generate page logic. This will be fixed in the next release.