Last Updated on April 14, 2025 by Arnav Sharma
When deploying resources in Microsoft Azure, understanding naming conventions is essential for avoiding deployment errors and ensuring services function as expected. Different Azure resources have different naming scope requirements: some must be globally unique due to DNS constraints, while others only need to be unique within a resource group or subscription. In this post, I’ve compiled a comprehensive table outlining these uniqueness requirements so you can plan and name your Azure resources more effectively.
Here are some resources and their naming restrictions and requirements:
| Resource Type | Uniqueness Scope | Naming Description / Limitations |
|---|---|---|
| Storage Account | Global | Globally unique DNS name. Lowercase letters and numbers only, 3-24 chars. |
| Key Vault | Global | Globally unique for secure DNS access. Alphanumeric and hyphens, 3-24 chars. |
| App Service (Web App) | Global | Globally unique domain. Alphanumeric and hyphens, 2-60 chars. |
| App Service Plan | Resource Group | Unique within resource group. Alphanumeric and hyphens, 1-40 chars. |
| Virtual Machine | Resource Group | Unique within resource group. Max 15 chars for Windows, 64 for Linux. |
| Virtual Network | Resource Group | Unique within resource group. Letters, numbers, periods, hyphens, 2-64 chars. |
| Subnet | Virtual Network | Unique within the VNet. Letters, numbers, periods, hyphens, 1-80 chars. |
| Network Interface | Resource Group | Unique within resource group. Letters, numbers, hyphens, 1-80 chars. |
| Public IP Address | Resource Group | Unique within resource group. Letters, numbers, hyphens, 1-80 chars. |
| Network Security Group | Resource Group | Unique within resource group. Letters, numbers, hyphens, 1-80 chars. |
| Azure SQL Server | Global | Globally unique DNS name. Lowercase letters and numbers, 1-63 chars. |
| Azure SQL Database | SQL Server | Unique within SQL server. Letters, numbers, hyphens, 1-128 chars. |
| Cosmos DB Account | Global | Globally unique DNS name. Lowercase letters and numbers, 3-50 chars. |
| Container Registry | Global | Globally unique login server. Lowercase letters and numbers, 5-50 chars. |
| Kubernetes Service (AKS) | Resource Group | Unique within resource group. Alphanumeric and hyphens, 1-63 chars. |
| Data Factory | Global | Globally unique. Alphanumeric and hyphens, 3-63 chars. |
| Synapse Workspace | Global | Globally unique URL. Letters, numbers, hyphens, 3-63 chars. |
| Logic App | Resource Group | Unique within resource group. Alphanumeric and hyphens, 1-80 chars. |
| Function App | Global | Globally unique domain. Letters, numbers, hyphens, 1-60 chars. |
| Event Hub Namespace | Global | Globally unique. Letters, numbers, hyphens, 6-50 chars. |
| Service Bus Namespace | Global | Globally unique. Letters, numbers, hyphens, 6-50 chars. |
| Application Gateway | Resource Group | Unique within resource group. Alphanumeric, hyphens, 1-80 chars. |
| Load Balancer | Resource Group | Unique within resource group. Alphanumeric, hyphens, 1-80 chars. |
| Front Door | Global | Globally unique. Letters, numbers, hyphens, 3-50 chars. |
| Traffic Manager Profile | Global | Globally unique DNS name. Letters, numbers, hyphens, 1-63 chars. |
| Redis Cache | Global | Globally unique DNS. Letters, numbers, hyphens, 1-63 chars. |
| Automation Account | Resource Group & Region | Unique in RG and region. Alphanumeric, hyphens, 6-50 chars. |
| Batch Account | Region | Unique in region. Lowercase letters and numbers, 3-24 chars. |
| Bot Service | Global | Globally unique. Alphanumeric, hyphens, periods, 2-64 chars. |
| Cognitive Services | Resource Group | Unique in RG. Alphanumeric, hyphens, 2-64 chars. |
| HDInsight Cluster | Global | Globally unique. Letters, numbers, hyphens, 3-59 chars. |
| IoT Central App | Global | Globally unique. Lowercase letters, numbers, hyphens, 2-63 chars. |
| Lab Services Plan | Resource Group | Unique in RG. Alphanumeric, hyphens, 1-100 chars. |
| ML Workspace | Resource Group | Unique in RG. Alphanumeric, hyphens, 3-33 chars. |
| User Assigned Managed Identity | Resource Group | Unique in RG. Alphanumeric, hyphens, 3-128 chars. |
| Maps Account | Resource Group | Unique in RG. Alphanumeric, hyphens, max 98 chars (incl. RG name). |
| Media Services Account | Region | Unique in region. Lowercase letters and numbers, 3-24 chars. |
| NetApp Files Account | Resource Group | Unique in RG. Alphanumeric, hyphens, 1-128 chars. |
| Notification Hubs Namespace | Global | Globally unique. Letters, numbers, hyphens, 6-50 chars. |
| Operational Insights Workspace | Resource Group | Unique in RG. Alphanumeric, hyphens, 4-63 chars. |
| Recovery Services Vault | Resource Group | Unique in RG. Letters, numbers, hyphens, 2-50 chars. |
| Resource Group | Subscription | Unique in subscription. Letters, numbers, (), ., _, -, 1-90 chars. |
| Role Assignment | Tenant | Globally unique GUID. |
| Role Definition | Tenant | Globally unique GUID. |
| Policy Definition | Subscription or MG | Unique within subscription or management group. |
I help organisations secure their cloud infrastructure and stay ahead of evolving cyber threats. Microsoft MVP and Certified Trainer, author of Mastering Azure Security, and founder of arnav.au — a platform for practical Cloud, Cybersecurity, DevOps and AI content.
Frequently Asked Questions
Several Azure resources require globally unique names due to DNS constraints, including Storage Accounts, Key Vaults, App Services, Azure SQL Servers, Cosmos DB Accounts, Container Registries, Data Factories, Function Apps, Event Hub Namespaces, Service Bus Namespaces, Front Door, Traffic Manager Profiles, Redis Cache, HDInsight Clusters, and IoT Central Apps. These resources need globally unique names because they are publicly accessible via DNS and cannot have naming conflicts across the entire Azure platform.
Globally unique names must be unique across all Azure subscriptions and regions worldwide, making them harder to obtain but necessary for publicly accessible services. Resource group unique names only need to be unique within a specific resource group, allowing you to reuse the same name in different resource groups or subscriptions, which provides more flexibility for naming resources.
Storage Accounts allow only lowercase letters and numbers and must be 3-24 characters long. Key Vaults allow alphanumeric characters and hyphens and must also be 3-24 characters long. Both resources require globally unique names due to their DNS-based access patterns.
Windows Virtual Machines have a maximum name length of 15 characters, while Linux Virtual Machines can have names up to 64 characters long. Both must be unique within their resource group and can contain alphanumeric characters and hyphens.
Automation Accounts must be unique within both a resource group and region, Batch Accounts must be unique within a region, and Media Services Accounts must be unique within a region. These resources have region-level scoping rather than global or resource group scoping, which affects how you plan your naming strategy across multiple regions.