Naming Conventions for Azure Resources

Naming Conventions for Azure Resources

TL;DR: We’ve all been there: a quick chat about naming conventions suddenly turns into a full-blown naming symposium. One wants dashes, another swears by PascalCase, and someone always brings up ‘naming things is hard’. This guide won’t end the debates (nothing will), but it will give you a solid, practical approach to naming your Azure resources and resource groups. A clear convention helps with automation, governance, and keeping your cloud chaos in check. Just remember – this is a recommendation, not a religion. Feel free to adapt, adjust, or politely ignore.

Overview

Naming things in Azure is hard, but a clear convention makes your cloud life easier. This guide gives you practical, opinionated patterns for naming Azure resources and resource groups, including how to handle special cases, restrictions, and multiple instances. You’ll find real-world examples, links to official docs, and tips for keeping your environment organized and automation-friendly. Use these rules as a starting point—adapt them to your needs, and don’t be afraid to tweak as your cloud grows.

General Principles

A naming convention can be imagined as a root structure. The further down it goes, the more variations there are. At each level of the root node, there are equivalent alternatives. It is important to follow this rule and never break it.

Resource Group Naming

All the resources in your resource group should share the same lifecycle (Microsoft). You deploy, update, and delete them together. If one resource, such as a server, needs to exist on a different deployment cycle it should be in another resource group (workload).

Resource Groups

Resource Naming

Resource Naming

Instances

Perhaps multiple instances of a resource type are required within a resource group. In such cases, an instance counter can be appended to the name. But as a reminder, do not break the rule of the root structure. Example:

  • webflow-prod-westeurope-avd-hostpool-001
  • wf-iv7c2daboloe4-kv-001

Special Resource Names

Naming Restrictions

Azure offers resource types with specific limitations such as storageaccount, keyvault, and compute galleries. These resources require a globally unique name and have character restrictions. To address this, you can use the uniqueString() function of bicep / arm. The resource group id contains all necessary information (subscriptionid, prefix, stage, region, workload) that defines a globally unique resource on Azure. This id serves as the value for the uniqueString() function.

Example

Resource Type Code Example Result Restriction
storageaccount ${prefix}${uniqueString(resourceGroup().id)}st wfiv7c2daboloe4st Microsoft.Storage
keyvault ${prefix}-${uniqueString(resourceGroup().id)}-kv wf-iv7c2daboloe4-kv Microsoft.KeyVault

Powershell

The same unique string can be generated with the AzExpression module in PowerShell.

1
2
3
Install-Module AzExpression

New-AzUniqueString -InputStrings "/subscriptions/SUBSCRIPTIONID/resourceGroups/webflow-prod-westeurope-avd-rg"

This will result exactly in the same unique string as the uniqueString() function of bicep / arm.

Tags

If it requires additional information on your resource or resource group, Microsoft recommends to use tags to organize your Azure resources. (Microsoft)

Related Links


For more details or questions, feel free to reach out or open an issue in the repository.