User defined function for naming conventions #12352
Replies: 2 comments 5 replies
-
I could see why a user-defined function is tempting, but as you say it can look a little clunky and it can be solved in other ways as well. Depends how complicated you want to do it, but at the simplest end of the scale you can add the prefixes to a separate json file:
Add something like this to your main.bicep: And combine it with a unique string for resources that can have name collisions:
On the other end of the scale you have the Azure Naming Tool: That way you can do name generation as part of the build pipelines and what-not. |
Beta Was this translation helpful? Give feedback.
-
Hi @calindtech, You absolute legend ! I'm hoping for this in the future to be honest. |
Beta Was this translation helpful? Give feedback.
-
I would like to create a userdefined-function for get consistent naming convetions.
Now it is a bit clunky, but could be much easier if i could access the variables in the result object or if you could have a function body separate from result.
Here is my try so far, but its not pretty :
Beta Was this translation helpful? Give feedback.
All reactions