Skip to content

PowerShell function to generate an Azure Resource Manager naming convention in accordance with best practices and and naming limitations.

License

Notifications You must be signed in to change notification settings

timothywarner/psarmtools

Repository files navigation

Welcome to the Azure Resource Manager Toolkit!

Here you will find a collection of PowerShell modules designed to make your life working with ARM a bit easier.

Please feel free to submit fixes and enhancements via the GitHub pull request system. You can reach me directly at [email protected]. Thanks for stopping by!

New-ARMNamingConvention

This PowerShell function generates an Azure Resource Manager naming convention in accordance with best practices and and naming limitations.

Usage

The function has two mandatory parameters:

  • Project: Your project ID must begin with a letter and contain no more than four characters
  • Environment: You can specify Development, Staging, Testing, or Production

Here's an example showing partial output:

PS C:\>New-ARMNamingConvention -Project 'plur' -Environment 'Development'

Name DisplayName       Type Value          
    
rg   Resource Group    PaaS plur-8F-rg-dev 
vm   Virtual Machine   IaaS plur-8F-vm-dev 
st   Storage Account   IaaS plur8fstdev   

In the above output, the 8F represents a two-digit hexadecimal identifier. As you know, some Azure resources need to be globally unique, so this method attempts to make that easier for you.

Notice the storage account's format; this defers to the (frustrating) limitations of lowercase, alphanumeric storage account names with no intervening hyphens or underscores.

You are limited to a maximum of four characters for your project name. Azure has a 15-character requirement for virtual machine names, so I applied that 15-character maximum to all these proposed resource names. Better safe than sorry!

TODO

  • Finish comment-based help
  • Include additional Azure resources
  • Organize the IaaS and PaaS categories
  • Incorporate Pester tests
  • Add functionality to the output object

Credit

Special thanks to the following friends and fellow PowerShell community members for their help:

  • Jeff Hicks (@jeffhicks) - I couldn't have done this without you :)
  • Mike F. Robbins (@mikefrobbins) - Your code is my main reference material
  • Adam Bertram (@adbertram) - Your Pluralsight courses are fantastic

About

PowerShell function to generate an Azure Resource Manager naming convention in accordance with best practices and and naming limitations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published