Stop Naming Things Wrong at 2 AM: Why Azure's Naming Rules Nearly Broke Me
Admin User
Author
Three months into my current role, I deployed a storage account at midnight with a name that was one character too long. Azure rejected it silently in the pipeline, and I spent the next hour digging through documentation scattered across five different pages, cross-referencing character limits, checking if hyphens were allowed, wondering if I'd gone insane. I hadn't. Azure's naming rules are just genuinely annoying—each resource type has its own quirks, and Microsoft doesn't exactly make them easy to find in one place.
That night, I became that developer. The one frantically checking the Cloud Adoption Framework docs while standing in front of a blocked deployment. I remember thinking: "There has to be a better way to handle this before it bites me again in production."
Recently, I came across a tool that actually solves this problem, and I want to talk about why this matters more than it seems on the surface. It's not just about convenience—it's about reducing the friction between you and deploying infrastructure reliably.
The Real Problem With Azure Naming Conventions
Let me be clear: Azure's resource naming rules aren't unreasonable. They exist for good reasons. Storage accounts need to be globally unique and have character restrictions because of how they're exposed via DNS. Key Vaults have soft delete behavior that reserves names. Container registries need alphanumeric-only names due to how they're referenced.
The problem isn't the rules themselves. It's that they're fragmented.
You're supposed to follow the Cloud Adoption Framework (CAF), which Microsoft designed well. But then you actually need to implement it across 200+ different resource types, each with its own constraints. That's when you realize the framework is a guide, not a machine-readable spec. I've spent too many hours hunting through documentation, finding contradictions, and then discovering at deploy time that something didn't match.
What This Tool Actually Solves
The AzureNamer tool does something straightforward but invaluable: it encodes every Azure resource type's naming rules in one place. Not as documentation. As executable logic.
You input a naming pattern (workload, environment, region), and it generates compliant names for 204 resource types simultaneously. More importantly, it exports your entire naming scheme as Terraform or Bicep code with variables parameterized for dev, staging, and production environments.
Here's what makes this better than just reading docs: it's bidirectional. You can parse an existing name back into its components. You can see the rules reference for every type. And when a name needs to be shortened to fit constraints, it keeps the shortened version literal rather than silently dropping characters—which prevents silent failures.
Why This Matters in Real Infrastructure Code
I've worked on projects where naming conventions were treated as an afterthought. Someone writes a quick shell script to generate names, it works locally, then breaks in production because they didn't account for the global uniqueness requirement of storage accounts or the 24-character limit of Key Vaults.
Having a centralized source of truth for naming rules is infrastructure hygiene. It means your Terraform files reference the same naming logic, your documentation stays consistent, and your team doesn't spend time arguing about whether Container Registries allow underscores (they don't, by the way).
The export-as-code feature is particularly smart. Instead of storing naming conventions in a wiki that gets outdated, you're storing them in version control alongside your actual infrastructure code.
Where I'd Push Back Slightly
I appreciate what this tool does, but I want to be honest about limitations. First, it handles the technical rules perfectly. It doesn't make naming decisions for you. You still need to figure out what "workload" actually means in your organization—is it "api," "analytics," "website"? That's a governance conversation, not a technical one.
Second, I'd want to see this integrated deeper into IaC tooling. A Terraform module or an Azure CLI extension that validates names before deployment would catch errors earlier in the pipeline than generating a spreadsheet.
Third, the tool assumes you're following CAF exactly. Some teams use variations or entirely different conventions. Flexibility would be valuable there.
The Bigger Picture
What I actually like about this is simpler: it's a developer who hit a wall, built a tool to move past it, and shared it freely. That's how infrastructure tooling should evolve—from people doing the work, not consultants theorizing about it.
For anyone managing Azure infrastructure at scale, this removes a category of preventable errors. At minimum, bookmark it for the next time you're unsure whether a resource type allows hyphens or what the actual character limit is.
Have you built tooling to solve your own infrastructure pain points? What naming convention mistakes have actually bitten you in production?
Source: This post was inspired by "I built a free Azure naming tool that knows every resource type's rules" by Dev.to. Read the original article