microsoft / CloudAdoptionFramework

Code samples and extended documentation to support the guidance provided in the Microsoft Cloud Adoption Framework
https://aka.ms/CAF
Creative Commons Attribution 4.0 International
864 stars 621 forks source link

The first step in the AzNamingTool script first prompt doesn't seem to work properly #46

Closed jpierson-at-riis closed 1 year ago

jpierson-at-riis commented 2 years ago

I've cloned the repo and tried running Set-AzureNamingConfiguration.ps1 and following the prompts. When asked on the first prompt to enter the numbers for UNDESIRED components I entered 23 and then pressed ENTER but based on the next prompt it seems that my input was completely ignored.

Reproduction steps:

  1. Run Set-AzureNamingConfiguration.ps1 from Powershell.
  2. Type 23 and then press ENTER when prompted with the first prompt.

Expected results:

Components 2 and 3 should not be shown but all other components 1, 4, 5, 6, 7, 8 should show in the next prompt which is supposed to confirm the set of desired components.

Actual results:

Components 2 and 3 still remain in the list of desired components in the next prompt even though they were provided by following the instruction as UNDESIRED components. Additionally, component 8 does not appear in the next prompt even though it wasn't entered in as UNDSIRED.

Ex.

STEP 01: REMOVE THE UNDESIRED AZURE RESOURCE NAMING COMPONENTS

You have selected the following components:

    (1) ResourceType
    (2) Org
    (3) ProjAppSvc
    (4) VmRole
    (5) Environment
    (6) Location
    (7) Instance

Is this correct? Type Y for Yes or N for No

I've tried using two different versions of PowerShell ( 7.2.1 and 5.1.22000.282) and Windows 11.

jamasten commented 2 years ago

@jpierson-at-riis, this is expected behavior. If you review your actions, by inputting 2 and 3, the Org and UnitDept components should be removed. As you can see in your output above, the UnitDept component was removed. That's the reason 7 components are listed in the confirmation output. The Org component cannot be removed. If you look at the resources.csv file in the "data" directory, you will see that the Org component is excluded for most resources and optional for most of the rest. This was by design. I reviewed our ReadMe in the repository, and it appears we failed to mention this fact. I will update the documentation. However, if you feel the Org component should have the option to be removed fully, we will review that option. Please let us know. Thank you!

jpierson-at-riis commented 2 years ago

@jamasten, We ended up creating our own naming strategy largely influenced by Recommended abbreviations for Azure resource types) and Define your naming convention. I was really hoping to use this tool to help guide the process but wasn't able to get it to work for us at that time. Since the project isn't completed however there may be an opportunity for me to circle back in the next few months and retry the naming tool to see what I can come up with based on the feedback about Org. If I do I'll post my feedback here. Thanks!

jamasten commented 2 years ago

@jpierson-at-riis, the Azure Naming Tool is based on that documentation and those references are only a suggestion. Names can be configured any way you want, That is the point of the Naming Tool, to provide flexibility but consistency in Azure resource names. v2 will be released shortly so keep an eye out for that. It will address your concerns mentioned above.

jamasten commented 2 years ago

FYI, the PR has been submitted to add v2 to the repo: https://github.com/microsoft/CloudAdoptionFramework/pull/64