Skip to content

Azure Resource Naming Validation


Overview

Validation rules for Azure resource naming in this project. Two environments are deployed: dev and prod.


Key Vault Naming

Restrictions: 3–24 chars, alphanumeric + hyphens, no consecutive hyphens, globally unique.

Pattern: {org}-{env}-{project}-{loc}-kv

Environment Name Length
dev dna-dev-portfolio-we-kv 23 ✅
prod dna-prod-portfolio-we-kv 24 ✅

Bicep (infra/modules/key_vault.bicep):

bicep
var env_short = environment == 'dev' ? 'dev' : environment == 'prod' ? 'prod' : take(environment, 6)
var location_short = location == 'westeurope' ? 'we' : location == 'eastus' ? 'eu' : take(location, 2)
var key_vault_name = '${org}-${env_short}-${project}-${location_short}-kv'

Container Registry Naming

Restrictions: 5–50 chars, alphanumeric only, lowercase, globally unique.

Pattern: {org}{env}{project}{location}acr (hyphens stripped, location full)

Environment Name Length
dev dnadevportfoliowesteuropeacr 29 ✅
prod dnaprodportfoliowesteuropeacr 30 ✅

Bicep (infra/modules/container_registry.bicep):

bicep
var acr_name = '${org}${replace(environment, '-', '')}${project}${replace(location, '-', '')}acr'

Container Apps Naming

Restrictions: 2–32 chars, lowercase letters/numbers/hyphens, must start and end with alphanumeric, resource-group scoped.

Pattern: {org}-{env_short}-{project}-{loc_short}-{suffix}

Resource Dev name Prod name
Environment dna-dev-portfolio-we-cae dna-prd-portfolio-we-cae
Frontend CA dna-dev-portfolio-we-ca-fe dna-prd-portfolio-we-ca-fe
Backend CA dna-dev-portfolio-we-ca-be dna-prd-portfolio-we-ca-be

Bicep (infra/modules/container_apps.bicep):

bicep
var env_short = environment == 'dev' ? 'dev' : environment == 'prod' ? 'prd' : take(replace(environment, '-', ''), 6)
var location_short = location == 'westeurope' ? 'we' : location == 'eastus' ? 'eu' : take(location, 2)
var container_app_env_name = '${org}-${env_short}-${project}-${location_short}-cae'
var frontend_app_name      = '${org}-${env_short}-${project}-${location_short}-ca-fe'
var backend_app_name       = '${org}-${env_short}-${project}-${location_short}-ca-be'

Note: Container Apps uses prd for prod (not prod) to stay within 32 chars.


Resource Group Naming

Restrictions: 1–90 chars, very flexible, subscription-scoped.

Pattern: {org}-{env}-{project}-{location}-rg

Environment Name
dev dna-dev-portfolio-westeurope-rg
prod dna-prod-portfolio-westeurope-rg

Naming Summary

Resource Max length No hyphens Lowercase Pattern
Key Vault 24 org-env-project-loc-kv
Container Registry 50 orgenvprojectlocationacr
Container Apps 32 org-env_short-project-loc-suffix
Resource Group 90 org-env-project-location-rg

Location Abbreviations

Location Abbreviation
westeurope we
eastus eu
northeurope ne

Environment Abbreviations

Environment KV / ACR / RG Container Apps
dev dev dev
prod prod prd


References

Page history

Field Value
Last updated 2026-03-22

Changelog

Date PRs Summary
2026-03-22 #89 Rewrote to reflect actual naming conventions (dev/prod only, no staging/PR envs, no uniqueString hash) Storage Account section (no SA in project), PR/staging env examples, uniqueString hash approach for KV