Skip to main content

Naming scheme

warning

This is a work in progress / not battle tested naming scheme. I use components from it from time to time.

Feel free to use it, but don't blame me if it turns out it does not work.

Introduction

In this doc I try to suggest alterations to the Microsoft CAF naming scheme it fit my needs based on my experience working in Azure.

Throughout this doc I'll use following terms in the following way:

WordMeaning
SchemeAgreed and documented strategy and practices when it comes to how to name Azure resources.
ConventionInterchangable with "scheme", but I'll try to write "scheme" only.
PrefixPattern of the name: Components and the order of those.

Why have a naming scheme?

General

  • Names in Azure can't be altered after creation.
    • Thus naming scheme/convention should be thought of before creating Azure resources, not after.
  • Avoid human error:
    • Without uniformity and telling names, it's hard to get an overview, and easy to delete the wrong Azure resource.
  • Avoid wasting time:
    • Without a well documented naming scheme/convention, it's impossible to keep track of all rules, restrictions, limitations and special cases when creating names for Azure resources.
    • Avoid wasting time to delete and recreate resources when you find out that one of the last resources created can't have the name you want.
  • Avoid duplicate names.
    • Some Azure resource types only require the name to be unique within the resource group.
      • Thus when viewing all resources in Azure, some resources could end up with the same name.

Summarized

  • Uniformity.
  • Avoid naming conflict in as few characters as possible.

Baseline - The Microsoft CAF naming scheme

Instead of starting from scratch, let's reuse the already great baseline Microsoft provides in CAF.

Why alter the Microsoft CAF naming scheme?

Azure resources naming limitations

Many Azure resources have naming limitations, like what kind of characters can be used, and length (total amount of characters).

  • Every character counts, so don't bloat the naming scheme or convention with padding.

Some Azure resources' naming limitations is so strict that it requires a special naming scheme, which Microsoft hasn't already defined.

  • Like Storage Accounts.

Group resources that share lifecycle when sorting alphabetically

The Microsoft naming scheme defines the resource type as the first component in the prefix, which makes it so that resources that share lifecycle does not get grouped when sorting Azure resources alphabetically.

  • Tagging, searching and filtering can make this experience better without altering the Microsoft naming convention though.

Other benefits

  • Same length / number of characters for as many of the components in the prefix as possible, makes any list of resources more tidy and readable.

Unofficial abbreviations

Abbreviations that are missing in the Microsoft CAF abbreviation list.

  • Some of these resources can't actually be named in the Azure portal, but the abbreviation can still be used for documentation, diagrams and similar.
Provider and resourceHuman friendly nameSuggested abbreviationNote
Microsoft.Insights/activityLogAlertsActivity log alertsalar
Microsoft.Insights/metricAlertsMetric alertsmar
Microsoft.OperationsManagement/solutionsSentinelsentCan't name this resource, but useful for diagrams. Sentinel inherits the name of the Log Analytics Workspace it's tied to.
Microsoft.OperationsManagement/solutionsUpdate ManagementaaumCan't name this resource, but useful for diagrams.
?Update Management CenterumcDoes not seem one creates these as an Azure resource?
Microsoft.Web?On-premises Data GatewayodgwDoes not seem one creates these as an Azure resource?

Microsoft CAF naming scheme alterations

Prefix

Microsoft

  • Prefix: <resource_type_abbreviation>-<workload/application>-<environment>-<region>-<instance:3>
  • Example: pip-sharepoint-prod-westus-001
    • Length: 30 characters.

Altered

  • Prefix: <workload/application>-<environment:3>-<azure_region:4>-<instance:2>-<resource_type>
  • Example: sharepoint-prd-weeu-01-pip
    • Length: 26 characters.

Prefix components

Environment

Three characters for every environment.

Microsoft naming convention3ch2ch
devdevdv
platformplfpf
preprodppdpp
prodprdpd
stagestgst
testtstts

Instance

Cut a leading zero: How likely are we to reach more than 99 (01-99) instances?

Microsoft naming conventionAltered
00101
00202
.....
05555
.....
09999

Region

About

Microsoft suggested abbreviation for region is problematic, because:

  • Abbreviations are not defined for all Azure regions.
  • Abbreviations have variable length.
  • Abbreviations are unnessesary long for some regions.
  • It's not consequent: Some regions have cardinal directions first (west, east etc.), while others doesn't.
    • But it's hard to strike a balance between making a abbreviation for a geolocation agnostic/generic, vs. confusing/not maching the Azure region.

Suggestion

Within Europe: 4 letters by the actual Azure region name
  • Can easily avoid naming conflict within Europe.
  • Less confusing to name the region after what the actual Azure region is called, rather than by contry.
    • Example: West-Europe, which is in Amsterdam, west in the Netherlads.
International: <continent:2|country:2|cardinaldirection:2>
  • Hard to avoid naming conflict with this many regions.
  • Include continent to easily group Azure resources when sorted alphabetically.

Help abbreviations

Continents
Continent2ch
Antarticaan
Africaaf
Asiaas
Europeeu
North Americana
Oceaniaoc
South Americasa
Cardinal directions
Direction2ch1ch
Centralcec
Easteae
Northnon
Southsos
Westwew

Azure regions

Europe
Region name4ch by Azure region name6ch <continent:2|country:2|cardinal_direction:2>3ch <country:2|cardinal_direction:1>
Globalglobglobalglo
France Centralfrceeufrcefrc
France Southfrsoeufrsofrs
Germany Northgenoeudenoden
Germany West Centralgewceudewedew
North Europe (Dublin)noeueuieeaiee
Norway Eastnoeaeunoeanoe
Norway Westnoweeunowenow
Sweden Centralswceeusecesec
Switzerland Northswnoeuchnochn
Switzerland Westswweeuchwechw
UK Southuksoeugbsogbs
UK Westukweeugbwegbw
West Europe (Amsterdam)weeueunlwenlw

Special cases - Specific Azure resource types

Storage account

Justification
  • Limitations: Globally unique name, no hyphens, 3-24 characters.
Scheme
  • First two characters of each component in the the general naming prefix, except for region and resource type.
Example
  • shprweeu01st

Subnet

Justification
  • Subnets are not visible inside the Azure portal in the overview of Azure resources.
    • Thus naming can be short and consise.
  • Subnets can have NSGs and UDRs connected to it, thus for naming such "child resources", the resource type abbreviation should be included.
Scheme

<purpose>-snet

Example
  • ingress-snet

Virtual machine

Justification
  • Azure resource name of a virtual machine also becomes the hostname of the VM.
  • Limitations: 1-15 characters for Windows, 1-64 for Linux.
Scheme
  • Remove hyphens
  • Shorten workload/application name to an absolute max of 4 characters if it's long.
Example
  • spoprdweeu01vm

Special cases - Child resources

Justification

  • Certain resource types is tied to some other resource.
    • Name should reflect that.
  • For easier management, carent and child resources should be grouped when sorted alphabetically.

Example resource types

  • NIC (network interface)
  • NSG (network security group)
  • PEP (private endpoint)
  • PIP (public IP)
  • SNET (VNet subnet)
  • UDR (user defined routes)

Scheme

<name_of_parent_resource>-<abbreviation_for_child_resource_type>

Examples

NSG
  • NSG tied to subnet: sharepoint-prd-weeu-01-vnet-ingress-snet-nsg
  • NSG tied to a VM NIC: spoprdweeu01-nic-nsg
Private endpoint
  • Storage account private endpoint for blob: shprweeu01st-pep-blob
    • Has multiple different endpoints, in contrast to Key Vault.
  • Key Vault private endpoints for vault: sharepoint-prd-weeu-01-kv-pep
    • Only has one endpoint, in contrast to Storage Account.

Resources

Microsoft naming recommendations

Bicep

Azure regions

Geographics

3rd party