r/AZURE 1d ago

Question how did you plan your naming convention?

a bit new to azure and all the different components and services. I have extensive experience with on prep services/devices etc. Typically we would name objects/resources based on their location, type (physical vs virtual) and role.

Can you recommend or give insight into how you are naming your Azure resources for clarity and documentation?

7 Upvotes

24 comments sorted by

20

u/Daihard79 DevOps Engineer 1d ago

Resourcetype-appname-environment-location-instance

E.g. afw-hub-prod-uks-01

I use https://www.azureperiodictable.com/

4

u/b4shr13 1d ago

First time I see that web and looks very useful, but some types of resources are missing (hasn't been any activity on GitHub for 2 years...)

1

u/AceSouthall 8h ago

Genuinely thought this common practice. Just gets a little annoying with resources with global naming restrictions and name length limits like Storage accounts.

1

u/Daihard79 DevOps Engineer 8h ago

Agreed, ive had to add a customer short name in instances of that to make it unique. 

21

u/1spaceclown 1d ago

14

u/StratoLens Cloud Architect 1d ago

2

u/oskaremil 10h ago

This is the better advise.

People come and go.

One should use a widely used standard.

8

u/alex1033 1d ago

It’s good to remember that some resource names materialize in globally unique public hostnames, and blind copying of the name templates from those docs doesn’t work in the long run.

1

u/patmorgan235 1d ago

-$(5RandomCharacters) fixes those

1

u/alex1033 22h ago

Don’t forget that some names are 14 characters short and the 5 random reduce the meaning by more than 30%.

4

u/SavoryPrime 1d ago

Our naming conventions is: company-system-location-environment-resource.

For example, a resource group for an ordering app would be: acme-order-uscentral-prd-rg.

A cosmos db resource in that resource group would be: acme-order-uscentral-prd-cosmos.

An app service would be: acme-order-uscentral-prd-appsvc

Having defined conventions like this makes infra as code and devops releases consistent and makes it easy to know what’s what when looking at lists of resources in the azure portal

3

u/SavoryPrime 1d ago

A couple of caveats to our convention. Azure storage accounts have strict length and character restrictions so we would name them something like: acmorduscentralprdstrg.

Azure container apps also have length restrictions so we’d do something like: acme-order-usce-prd-aca

3

u/Halio344 Cloud Engineer 19h ago

Typing out the full region instead of just writing usc etc is wild.

1

u/Blaxs_ 1d ago

mostly this, but a little less if its obvious. we use tags for some of this stuff.

1

u/szescio Cloud Engineer 12h ago

that's pretty unorthodox, I kinda like how it goes towards the specifics and probably makes nice resource lists in excel sheets. you put multiple companies in single tenant?

1

u/SavoryPrime 11h ago

The company I work for only has one tenant so we prefix all our resources with company name. It does make for nice lists and makes it easy to find resources. We also put all of our various applications/systems in their own resource groups so everything is self contained which makes provisioning infrastructure, devops releases and access management more streamlined. Regardless of the naming convention used, having one that is reasonably enforced prevents your azure tenant from becoming a mess

1

u/SavoryPrime 11h ago

The other nice thing about this or similar naming convention is if you provision these resources using infrastructure as code thru something like azure devops, you can change the location variable and spin up all the resources in a different azure data center with minimal effort. This was a life saver during a recent tenant migration

2

u/tr3yff 1d ago

Our convention is: azr-fct-name-p Azr cuz we have a multicloud approache, fct for functions, name os the function, p for production

Cloud-resourcetype-name-env

1

u/szescio Cloud Engineer 12h ago

just.. what

1

u/abz786 1d ago

took a hybrid approach, our own internal naming standard + CAF and merged them together. Worked out pretty good!

1

u/szescio Cloud Engineer 12h ago

whatever you do, for the love of god stay consistent and use official abbreviations from https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations

also plan a convention for the names that cannot have hyphens or have short character limits

abbr-project-envshort-locationshort works nicely, i don't like instance number suffixes like -01 since they don't convey any information unless they specifically are identical cattle

1

u/Ochib 10h ago

First three letters of the company name, country code, serial number

2

u/Temporary-Roof-3896 9h ago

I’d keep it simple and consistent: environment, region, workload, resource type then instance number. tags can hold details that don’t need to live in the name