How to Define Naming Convention in Azure

An effective naming convention consists of resource names from important information about each resource. A good name helps you quickly identify the resource’s type, associated workload, environment, and the Azure region hosting it. For example, a public IP resource for a production SharePoint workload in the West US region might be pip-sharepoint-prod-westus-001.

Diagram that shows the components of an Azure resource name.

Diagram 1: Components of an Azure resource name.

When you construct your naming convention, identify the key pieces of information you want to reflect in a resource name. Different information is relevant for different resource types, and not all established naming components can be used for each resource type. The intention is to have a standard naming convention for your environment that is easy to follow, concise, and useful for recognizing information that’s relevant to the deployed resource.

The following list provides examples of naming components that are useful when you construct resource names:

Naming componentDescription
OrganizationTop-level name of organization, normally utilized as top management group or, in smaller organizations, part of the naming convention. Example: contoso
Business unit or departmentTop-level division of your company that owns the subscription or workload the resource belongs to. In smaller organizations, this component might represent a single corporate top-level organizational element. Examples: finmktgproductitcorp
Resource typeAn abbreviation that represents the type of Azure resource or asset. This component often is used as a prefix or suffix in the name. For more information, see Recommended abbreviations for Azure resource types. Examples: rgvm
Project, application, or service nameName of a project, application, or service that the resource is a part of. Examples: navigatoremissionssharepointhadoop
EnvironmentThe stage of the development lifecycle for the workload that the resource supports. Examples: proddevqastagetest
LocationThe region or cloud provider where the resource is deployed. Examples: westuseastus2westeuusvaustx
VM roleIdentifier for the purpose of the VM. Examples: db (database), ws (web server), ps (print server)
InstanceThe instance count for a specific resource to identify more than one resource that has the same naming convention. Examples, 01001

 Note

Although virtual machine (VM) names in Azure can be longer than the allowed NetBIOS name of the VM, we recommend that you keep them consistent. For more information and for other restrictions, see Computer names.

Naming considerations

In addition to defining the naming components, you must also consider the order in which the naming components should be listed, if and what type of delimiters you should use between components, and take into account the different naming rules associated with resources types.

Scope

All Azure resource types have a scope that defines the level of that resource and that the resource names must be unique. A resource must have a unique name within its scope.

For example, a virtual network has a resource group scope, which means that there can be only one network named vnet-prod-westus-001 in a given resource group. Other resource groups could have their own virtual network named vnet-prod-westus-001. Subnets are scoped to virtual networks, so each subnet within a virtual network must have a distinct name.

Some resource names, such as PaaS services with public endpoints or virtual machine DNS labels, have global scopes, so they must be unique across the entire Azure platform.

Diagram that shows the scope levels for Azure resource names.

Diagram 2: Scope levels for Azure resource names.

Azure naming rules

Azure naming rules vary depending on the resource type. When you define a naming convention, it’s important to understand Azure naming rules for the resource type to avoid confusion and delay deployments.

For example, resource names have length limits. We recommend that you keep the length of naming components short to prevent exceeding resource name length limits.

 Note

Balancing the context of a name with its scope and name length limit is important when you develop your naming conventions. For more information, see Naming rules and restrictions for Azure resources.

When you construct your naming convention, identify the key pieces of information that you want to reflect in a resource name. Different information is relevant for different resource types. The following list provides examples of information that’s useful when you construct resource names.

You can abbreviate resource names and naming components as a strategy to reduce the length and complexity of resource names. Shortening names can be useful for any of the naming components, but it’s especially important to help you keep resource names within name length limits. For example, a VM name in Azure can be longer than the OS naming restrictions. Keeping Azure VM names shorter than the naming restrictions of the OS helps create consistency, improve communication when discussing resources, and reduce confusion when you are working in the Azure portal while being signed in to the VM itself.

Naming componentDescription
Resource typeAn abbreviation that represents the type of Azure resource or asset. This component is often used as a prefix or suffix in the name. For more information, see Recommended abbreviations for Azure resource types.
Examples: rgvm
Business unitTop-level division of your company that owns the subscription or workload the resource belongs to. In smaller organizations, this component might represent a single corporate top-level organizational element.
Examples: finmktgproductitcorp
Application or service nameName of the application, workload, or service that the resource is a part of.
Examples: navigatoremissionssharepointhadoop
Subscription purposeSummary description of the purpose of the subscription that contains the resource. Often broken down by environment or specific workloads.
Examples: prodsharedclient
EnvironmentThe stage of the development lifecycle for the workload that the resource supports.
Examples: proddevqastagetest
RegionThe Azure region where the resource is deployed.
Examples: westuseastus2westeuusvaustx

 Note

When you’re ready to name your resources and assets, review Recommended abbreviations for Azure resource types.

The following section provides example names for common Azure resource types in an enterprise cloud deployment.

 Note

Some of these example names use a three-digit padding scheme (###), such as mktg-prod-001.

Padding improves readability and sorting of assets when those assets are managed in a configuration management database (CMDB), IT Asset Management tool, or traditional accounting tools. When the deployed asset is managed centrally as part of a larger inventory or portfolio of IT assets, the padding approach aligns with interfaces those systems use to manage inventory naming.

Unfortunately, the traditional asset padding approach can prove problematic in infrastructure-as-code approaches that might iterate through assets based on a non-padded number. This approach is common during deployment or automated configuration management tasks. Those scripts would have to routinely strip the padding and convert the padded number to a real number, which slows script development and run time.

Choose an approach that’s suitable for your organization. The padding shown here illustrates the importance of using a consistent approach to inventory numbering, rather than showing which approach is superior. Before choosing a numbering scheme, with or without padding, evaluate what will affect long-term operations more, CMDB and asset management solutions or code-based inventory management. Then, consistently follow the padding option that best fits your operational needs.

The following section provides some example names for common Azure resource types in an enterprise cloud deployment. For additional examples, see the Azure Naming Tool and the Naming and tagging tracking template.

 Note

The following examples are intended to provide visualization of a naming convention, but actual conventions will vary by organization.

Example names: General

Asset typeScopeFormat and examples
Management groupBusiness unit and/or
environment
mg-<business unit>[-<environment>]

mg-mktgmg-hrmg-corp-prodmg-fin-client
SubscriptionAccount / enterprise agreement<business unit>-<subscription purpose>-<###>

mktg-prod-001corp-shared-001fin-client-001
Resource groupSubscriptionrg-<app or service name>-<subscription purpose>-<###>

rg-mktgsharepoint-prod-001rg-acctlookupsvc-shared-001rg-ad-dir-services-shared-001
API management service instanceGlobalapim-<app or service name>

apim-navigator-prod
Managed identityResource groupid-<app or service name>-<environment>-<region name>-<###>

id-appcn-keda-prod-eastus2-001

Example names: Networking

Asset typeScopeFormat and examples
Virtual networkResource groupvnet-<subscription purpose>-<region>-<###>

vnet-shared-eastus2-001vnet-prod-westus-001vnet-client-eastus2-001
SubnetVirtual networksnet-<subscription purpose>-<region>-<###>

snet-shared-eastus2-001snet-prod-westus-001snet-client-eastus2-001
Network interface (NIC)Resource groupnic-<##>-<vm name>-<subscription purpose>-<###>

nic-01-dc1-shared-001nic-02-vmhadoop1-prod-001nic-02-vmtest1-client-001
Public IP addressResource grouppip-<vm name or app name>-<environment>-<region>-<###>

pip-dc1-shared-eastus2-001pip-hadoop-prod-westus-001
Load balancerResource grouplb-<app name or role>-<environment>-<###>

lb-navigator-prod-001lb-sharepoint-dev-001
Network security group (NSG)Subnet or NICnsg-<policy name or app name>-<###>

nsg-weballow-001nsg-rdpallow-001nsg-sqlallow-001nsg-dnsblocked-001
Local network gatewayVirtual gatewaylgw-<subscription purpose>-<region>-<###>

lgw-shared-eastus2-001lgw-prod-westus-001lgw-client-eastus2-001
Virtual network gatewayVirtual networkvgw-<subscription purpose>-<region>-<###>

vgw-shared-eastus2-001vgw-prod-westus-001vgw-client-eastus2-001
Site-to-Site connectionResource groupcn-<local gateway name>-to-<virtual gateway name>

cn-lgw-shared-eastus2-001-to-vgw-shared-eastus2-001cn-lgw-shared-eastus2-001-to-vgw-shared-westus-001
VPN connectionResource groupcn-<subscription1 purpose>>-<region1>-to-<subscription2 purpose>>-<region2>-

cn-shared-eastus2-to-shared-westuscn-prod-eastus2-to-prod-westus
Route tableResource grouproute-<route table name>

route-navigatorroute-sharepoint
DNS labelGlobal<DNS A record for VM>.<region>.cloudapp.azure.com

dc1.westus.cloudapp.azure.comweb1.eastus2.cloudapp.azure.com

Example names: Compute and Web

Asset typeScopeFormat and examples
Virtual machineResource groupvm<vm role><environment><###>

vmsqltest001vmhadoopprod001
Web appGlobalapp-<project, app or service>-<environment>-<###>.azurewebsites.net

app-navigator-prod-001.azurewebsites.netapp-accountlookup-dev-001.azurewebsites.net
Function appGlobalfunc-<project, app or service>-<environment>-<###>.azurewebsites.net

func-navigator-prod-001.azurewebsites.netfunc-accountlookup-dev-001.azurewebsites.net

Example names: Databases

Asset typeScopeFormat and examples
Azure SQL databaseAzure SQL Databasesqldb-<project, app or service>-<environment>

sqldb-users-prodsqldb-users-dev
Azure Cosmos DB databaseGlobalcosmos-<project, app or service>-<environment>

cosmos-navigator-prodcosmos-emissions-dev
Azure Cache for Redis instanceGlobalredis-<project, app or service>-<environment>

redis-navigator-prodredis-emissions-dev

Example names: Storage

Asset typeScopeFormat and examples
Storage account (general use)Globalst<project, app or service><###>

stnavigatordata001stemissionsoutput001
Azure StorSimpleGlobalssimp<project, app or service><environment>

ssimpnavigatorprodssimpemissionsdev
Azure Container RegistryGlobalcr<project, app or service><environment><###>

crnavigatorprod001

Example names: AI and machine learning

Asset typeScopeFormat and examples
Azure Cognitive SearchGlobalsrch-<project, app or service>-<environment>

srch-navigator-prodsrch-emissions-dev
Azure Cognitive ServicesResource groupcog-<project, app or service>-<environment>

cog-navigator-prodcog-emissions-dev
Azure Machine Learning workspaceResource groupmlw-<project, app or service>-<environment>

mlw-navigator-prodmlw-emissions-dev

Example names: Analytics and IoT

Asset typeScopeFormat and examples
Azure Data FactoryGlobaladf-<project, app or service>-<environment>

adf-navigator-prodadf-emissions-dev
Azure Stream AnalyticsResource groupasa-<project, app or service>-<environment>

asa-navigator-prodasa-emissions-dev
Data Lake Storage accountGlobaldls<project, app or service><environment>

dlsnavigatorproddlsemissionsdev
IoT hubGlobaliot-<project, app or service>-<environment>

iot-navigator-prodiot-emissions-dev

Example names: Integration

Asset typeScopeFormat and Examples
Service BusGlobalsb-<project, app or service>-<environment>.servicebus.windows.net

sb-navigator-prod.servicebus.windows.netsb-emissions-dev.servicebus.windows.net
Service Bus queueService Bussbq-<query descriptor>

sbq-messagequery
Service Bus topicService Bussbt-<query descriptor>

sbt-messagequery

Ref: Define your naming convention – Cloud Adoption Framework | Microsoft Learn