![Azure](/wp-content/uploads/2023/02/Azure-1-768x432.jpg)
How to name resources in Azure?
In this article, we’ll look at rules, recommendations, and examples for naming resource names in Azure.
It is important to effectively call resource names from information about each resource, to avoid conflicts, and to ensure readability and understandability of the resources. A good resource name allows you to quickly identify the organization, department, resource type, environment, Azure region, instance, etc.
Azure naming rules
For Azure resources, Microsoft recommends following the following naming conventions:
- Use names in lowercase and separated by hyphens
- Use letters and numbers, with a maximum of 24 characters.
- Do not use special characters, such as @, #, $, %, &, *, etc.
- Do not use Azure reserved words, such as “Azure”, “Microsoft”, etc.
- Do not use names similar to Azure services, such as “SQL”, “Storage”, etc.
- Use a descriptive and meaningful name for the resource, such as “my-azure-resource” or “my-app-resource”.
- If a prefix or suffix is used, make sure it is clear and consistent, such as “app-” or “-prod”.
These conventions help avoid conflicts and maintain the organization and readability of resources on the Azure platform.
Naming rules and restrictions for Azure resources
Naming options for constructing resource names
Here is a list of sample naming options that are useful when constructing resource names. For each type of resource you can use some naming options or others. The intent is to have a standard naming convention that is easy to follow, concise, and useful for recognizing information that is relevant to the created resource.
Naming component | Description |
---|---|
Organization | Top-level name of organization, normally utilized as top management group or, in smaller organizations, part of the naming convention. Example: contoso |
Business unit or department | Top-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: fin , mktg , product , it , corp |
Resource type | An 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: rg , vm |
Project, application, or service name | Name of a project, application, or service that the resource is a part of. Examples: navigator , emissions , sharepoint , hadoop |
Environment | The stage of the development lifecycle for the workload that the resource supports. Examples: prod , dev , qa , stage , test |
Location | The region or cloud provider where the resource is deployed. Examples: westus , eastus2 , westeu , usva , ustx |
VM role | Identifier for the purpose of the VM. Examples: db (database), ws (web server), ps (print server) |
Instance | The instance count for a specific resource to identify more than one resource that has the same naming convention. Examples, 01 , 001 |
The order in which the naming options should appear is important.
Scope
Resource names must be unique within their scope.
- Global – Unique across the Azure platform. For example, PaaS services with public endpoints or virtual machine DNS labels.
- Resource Group – Unique within the resource group. For example, a virtual network has a resource group scope, which means that there can only be one network called
vnet-prod-westus-001
in a given resource group. Other resource groups might have their own virtual network calledvnet-prod-westus-001
- Resource attribute : Unique within the parent resource. For example: Subnets are scoped to virtual networks so each subnet in a virtual network must have a different name.
Examples of resource names
These are examples with naming considerations, but will vary by organization.
General
Asset type | Scope | Format and examples |
---|---|---|
Management group | Business unit and/or environment | mg-<business unit>[-<environment>] mg-mktg mg-hr mg-corp-prod mg-fin-client |
Subscription | Account / enterprise agreement | <business unit>-<subscription purpose>-<###> mktg-prod-001 corp-shared-001 fin-client-001 |
Resource group | Subscription | rg-<app or service name>-<subscription purpose>-<###> rg-mktgsharepoint-prod-001 rg-acctlookupsvc-shared-001 rg-ad-dir-services-shared-001 |
API management service instance | Global | apim-<app or service name> apim-navigator-prod |
Managed identity | Resource group | id-<app or service name>-<environment>-<region name>-<###> id-appcn-keda-prod-eastus2-001 |
networking
Asset type | Scope | Format and examples |
---|---|---|
Virtual network | Resource group | vnet-<subscription purpose>-<region>-<###> vnet-shared-eastus2-001 vnet-prod-westus-001 vnet-client-eastus2-001 |
Subnet | Virtual network | snet-<subscription purpose>-<region>-<###> snet-shared-eastus2-001 snet-prod-westus-001 snet-client-eastus2-001 |
Network interface (NIC) | Resource group | nic-<##>-<vm name>-<subscription purpose>-<###> nic-01-dc1-shared-001 nic-02-vmhadoop1-prod-001 nic-02-vmtest1-client-001 |
Public IP address | Resource group | pip-<vm name or app name>-<environment>-<region>-<###> pip-dc1-shared-eastus2-001 pip-hadoop-prod-westus-001 |
Load balancer | Resource group | lb-<app name or role>-<environment>-<###> lb-navigator-prod-001 lb-sharepoint-dev-001 |
Network security group (NSG) | Subnet or NIC | nsg-<policy name or app name>-<###> nsg-weballow-001 nsg-rdpallow-001 nsg-sqlallow-001 nsg-dnsblocked-001 |
Local network gateway | Virtual gateway | lgw-<subscription purpose>-<region>-<###> lgw-shared-eastus2-001 lgw-prod-westus-001 lgw-client-eastus2-001 |
Virtual network gateway | Virtual network | vgw-<subscription purpose>-<region>-<###> vgw-shared-eastus2-001 vgw-prod-westus-001 vgw-client-eastus2-001 |
Site-to-Site connection | Resource group | cn-<local gateway name>-to-<virtual gateway name> cn-lgw-shared-eastus2-001-to-vgw-shared-eastus2-001 cn-lgw-shared-eastus2-001-to-vgw-shared-westus-001 |
VPN connection | Resource group | cn-<subscription1 purpose>>-<region1>-to-<subscription2 purpose>>-<region2>- cn-shared-eastus2-to-shared-westus cn-prod-eastus2-to-prod-westus |
Route table | Resource group | route-<route table name> route-navigator route-sharepoint |
DNS label | Global | <DNS A record for VM>.<region>.cloudapp.azure.com dc1.westus.cloudapp.azure.com web1.eastus2.cloudapp.azure.com |
Compute and Web
Asset type | Scope | Format and examples |
---|---|---|
Virtual machine | Resource group | vm<vm role><environment><###> vmsqltest001 vmhadoopprod001 |
Web app | Global | app-<project, app or service>-<environment>-<###>.azurewebsites.net app-navigator-prod-001.azurewebsites.net app-accountlookup-dev-001.azurewebsites.net |
Function app | Global | func-<project, app or service>-<environment>-<###>.azurewebsites.net func-navigator-prod-001.azurewebsites.net func-accountlookup-dev-001.azurewebsites.net |
Databases
Asset type | Scope | Format and examples |
---|---|---|
Azure SQL database | Azure SQL Database | sqldb-<project, app or service>-<environment> sqldb-users-prod sqldb-users-dev |
Azure Cosmos DB database | Global | cosmos-<project, app or service>-<environment> cosmos-navigator-prod cosmos-emissions-dev |
Azure Cache for Redis instance | Global | redis-<project, app or service>-<environment> redis-navigator-prod redis-emissions-dev |
Storage
Asset type | Scope | Format and examples |
---|---|---|
Storage account (general use) | Global | st<project, app or service><###> stnavigatordata001 stemissionsoutput001 |
Azure StorSimple | Global | ssimp<project, app or service><environment> ssimpnavigatorprod ssimpemissionsdev |
Azure Container Registry | Global | cr<project, app or service><environment><###> crnavigatorprod001 |
AI and machine learning
Asset type | Scope | Format and examples |
---|---|---|
Azure Cognitive Search | Global | srch-<project, app or service>-<environment> srch-navigator-prod srch-emissions-dev |
Azure Cognitive Services | Resource group | cog-<project, app or service>-<environment> cog-navigator-prod cog-emissions-dev |
Azure Machine Learning workspace | Resource group | mlw-<project, app or service>-<environment> mlw-navigator-prod mlw-emissions-dev |
Analytics and IoT
Asset type | Scope | Format and examples |
---|---|---|
Azure Data Factory | Global | adf-<project, app or service>-<environment> adf-navigator-prod adf-emissions-dev |
Azure Stream Analytics | Resource group | asa-<project, app or service>-<environment> asa-navigator-prod asa-emissions-dev |
Data Lake Storage account | Global | dls<project, app or service><environment> dlsnavigatorprod dlsemissionsdev |
IoT hub | Global | iot-<project, app or service>-<environment> iot-navigator-prod iot-emissions-dev |
Integration
Asset type | Scope | Format and Examples |
---|---|---|
Service Bus | Global | sb-<project, app or service>-<environment>.servicebus.windows.net sb-navigator-prod.servicebus.windows.net sb-emissions-dev.servicebus.windows.net |
Service Bus queue | Service Bus | sbq-<query descriptor> sbq-messagequery |
Service Bus topic | Service Bus | sbt-<query descriptor> sbt-messagequery |
Conclusion
In conclusion, it is important to take into account some nomenclature considerations. These include using unique and easily identifiable names for each resource, following naming rules and limitations specific to each type of resource, and maintaining a logical and consistent naming structure to facilitate resource organization and management. It is also important to consider integration with other systems and the possibility of future changes in the nomenclature.