-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add support for the same unique suffix to used in all resource naming #78
base: main
Are you sure you want to change the base?
Conversation
Added logic to deployment script that will generate a unique suffix per deployment, that will be used in naming of all resources created
Updated parameter and variables to accept uniqueSuffix value and concat into resource names for deployment
Hey there @cocallaw, thank you so much for submitting this PR. I will thoroughly review this later today and provide some feedback. I had already been working on a solution for this on my end, so I just want to make sure we take the most holistic approach to solving this problem. |
At first glance, I see an issue with a use case where customers may have strict naming conventions for App Registrations and pass in a specific value for EngineAppName or UIAppName and don't want that modified with a uniqueString. Does that make sense @cocallaw? |
I see what you are @DCMattyG, checking to see if the suffix could possibly be set somewhere else on the App Registration objects such as internal notes to help with identification if user has deployed multiple times or failure on deployment. |
Perhaps a more "simple" solution is to check and see if the values do NOT match the defaults (provided at the top), which means a user has chosen a specific value. However, that doesn't address the other point that even if they do specify a value, what happens if the deploy fails and they need to redo it without creating the same SP's over and over. In the latter case, maybe we just add a cleanup to remove the created App Registrations if the deployment fails for any reason. That may solve the problem outright without needing to append a suffix as the root issue was end users having overlapping App Registrations after many failed deployment attempts. Thoughts? |
The command Could possibly store the suffix in tag, allowing users to specify any name they would like for the app registrations. To perform cleanup of the app registrations if the deployment fails, filter the registrations based on the value of tag if it matches the suffix, then require user confirmation before deletion. |
This PR updates the logic for the unique suffix used when naming resources deployed and applies the suffix to the display names of the two AAD app registration created.
Addresses comment by fajterini #69 (comment) and acknowledged by DCMattyG
Added
New-UniqueIPAMDeployString
$unique
and$uniqueSuffix
Removed
guid
Updated Flow
New-UniqueIPAMDeployString
called after initial setup and validation for the script occurs-- Function creates a unique 13 character string of numbers and lowercase letters and stores in
$unique
--
UIAppName
andEngineAppName
values are updated-- The value of
$unique
is returned from the functionDeploy-IPAMApplications
runs using the updated app name variables$unique
is passed into into function Deploy-Bicep as the value foruniqueSuffix
uniqueSuffix
value to build string variables for resource names