Azure naming convention
Naming components
-
Resource type: An abbreviation that represents the type of Azure resource or asset. It is recommended to use the official abbreviation recommendations for Azure resources.
-
Workload, application, or project: The name of the workload, application, or project that the resource is part of.
-
Environment: The stage of the lifecycle for the workload that the resource supports, for example:
devfor Developmentstgfor Stagingprodfor Production
In case we use deployment slots for a given resource (this is possible for App Services and Azure Functions) we can keep the actual environment in the app name (e.g.
func-test-function-prod-weu). This means that this resource and its deployment slots are intended for production usage. The slots can be namedfunc-test-function-prod-weu/stagingor even betterfunc-test-function-prod-weu/preprod. The resource should be namedfunc-test-function-stg-weu, only if its whole lifecycle is in the staging stage. -
Region: A short abbreviation for the Azure region or cloud provider location where the resource is deployed (for example,
weufor West Europe). -
(Optional) Instance: If there is already a resource with the same name, an instance number should be added at the end, the padding convention is a fixed length of 3 (e.g.
001,042,101).
Naming convention pattern
Resources
When naming an Azure resource, use the following convention as closely as possible. The name has the 4 (or 5) basic components in kebab-case with the exact above order, all lowercase, separated by hyphens (-).
The general pattern is:
<resource-type>-<workload-or-project>-<environment>-<region>(-<instance>)
The instance segment is optional and only used when needed.
Storage accounts
Storage accounts have the peculiarity of using just lowercase alphanumeric case so we still have to follow the resources rule without hyphens.
<resource-type><workloadorproject><environment><region>(<instance>)
Resource groups
Resource groups should follow the same pattern as resources.
rg-<workload-or-project>-<environment>-<region>(-<instance>)
Tagging strategy
Complementary to the naming convention a tagging strategy should be followed as well, to better filter services mainly for cost management.
The required tags are the following:
businessname: A human-readable form of the name (e.g. Third Party Message Receiver).solutionname: The corresponding solution project (e.g.People.IoT.MessageReceiver). If there is no such project leave it empty.app: The application that it is part of.environment: The lifecycle stage.owner: The owner who is primarily the creator and main contributor (e.g.Konstantinos Ioannou). They can change in the future.team: The development team responsible (e.g.tms-ai).user: (Optional) Used for Virtual Machine resources for us to know which is the root user assigned.
Make sure that the values of these fields are consistent, because even minor deviations can defeat the purpose of tagging.
Example
You want to deploy an Azure Container Apps resource for the TMS application that hosts a service called "routing". The environment is production and the region is West Europe.
- Azure Container Apps is abbreviated to
caas the Azure resource abbreviation recommendations. - The workload/application name combines
tmsand the service namerouting, resulting intms-routing. - The environment code is
prodfor Production. - The region abbreviation is
weufor West Europe.
Putting this together, the name is:
ca-tms-routing-prod-weu
If this name is already a resource with the same name, use an instance number:
ca-tms-routing-prod-weu-001
The tags are:
businessname: TMS AI Routing Service, solutionname: /tms/routing/, app: tms, environment: prod, owner: georgios frangias, team: ai
Sources
It is highly recommended you check in detail Azure's own manual on defining a naming convention. The pages from which these naming conventions are mainly drawn are the following: