Skip to main content
rule official · GitHub

azure-naming — GitHub Copilot rule: Azure CAF, how to install

The rule makes GitHub Copilot name Azure resources following Microsoft CAF: type prefix, workload, environment, region, instance number.

Install into GitHub Copilot · Manually: put the files in place All methods and platforms ↓
.github/instructions/azure-naming.instructions.md
Open on GitHub

What azure-naming does

The azure-naming rule feeds GitHub Copilot the abbreviation and length constraint tables from the Cloud Adoption Framework: rg-navigator-prod, func-payments-dev-001, vnet-shared-eastus2-001. Copilot applies it when generating Bicep, Terraform, .tfvars and .bicepparam, and for all files inside infra and infrastructure folders. Inside are two dozen resource types (virtual machines, networks, load balancers, Application Insights, Log Analytics) with prefixes, allowed characters and name length boundaries.

All you need is the rule file in one of your IDE folders. Copilot reads the table and inserts the right prefix along with the <type>-<workload>-<environment>-<region>-<instance> pattern where needed. Resources with global scope (Traffic Manager, web apps, functions) get shorter names without region and instance.

What it helps with

  • Name Azure resources following Microsoft CAF without manually checking docs
  • Insert the correct prefix and name length for VMs, networks, load balancers
  • Bring Bicep and Terraform names to a single team standard
  • Check a resource name for invalid characters and Azure constraints

Example prompts for the agent

  • Create a resource group for the payments project in prod, westus region
  • Name an Application Insights for navigator in dev environment, first instance
  • Generate names for a SQL virtual machine in test and its network interface

How to install azure-naming

Manually: put the files in place

.github/instructions/azure-naming.instructions.md

The applyTo field sets which files it applies to

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about azure-naming

How to install azure-naming in GitHub Copilot?

Put the rule file in .github/instructions/azure-naming.instructions.md — GitHub Copilot will pick it up when working with Bicep, Terraform and infra folders.

What does azure-naming do?

The rule teaches Copilot to name Azure resources following the Cloud Adoption Framework: type prefix, workload, environment, region and instance number in strict format.

Which resources does azure-naming set prefixes for?

Two dozen types: resource groups, virtual machines, networks, load balancers, Application Insights, Log Analytics, firewalls, CDN, Front Door and others.

Source text

azure-naming.instructions.md · MIT
---
applyTo: '**/*.bicep,**/*.tf,**/*.tfvars,**/*.bicepparam,**/infra/**,**/infrastructure/**'
description: 'Azure resource naming conventions based on Microsoft CAF (Cloud Adoption Framework). Use when creating, reviewing, or suggesting names for Azure resources.'
---

# Azure Resource Naming Conventions (CAF)

Source: [Define your naming convention](https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-naming) | [Abbreviations](https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations) | [Name rules](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules)

Always follow these rules when creating, suggesting, or reviewing Azure resource names.

---

## General Pattern

```
<resource-type-abbr>-<workload>-<environment>-<region>-<instance>
```

**Component rules:**
- **Resource type** — use the official abbreviation from the table below, placed first
- **Workload / app / project** — short descriptive name (e.g., `navigator`, `payments`)
- **Environment** — `prod`, `dev`, `qa`, `stage`, `test`
- **Region** — use Azure region short names: `westus`, `eastus2`, `westeurope`, `northeurope`, `uksouth`, `southeastasia`, `australiaeast`, etc.
- **Instance** — zero-padded number: `001`, `002`

> Some resource types deviate from this pattern (e.g., no hyphens allowed). See [Official Abbreviations and Naming Rules](#official-abbreviations-and-naming-rules) for per-resource patterns and constraints.

**General character rules:**
- Prefer lowercase letters and hyphens (`-`). No spaces, no underscores unless the resource type requires it.
- Some resources **do not allow hyphens** — use concatenated lowercase alphanumerics instead (see table).
- Do not use: `#`, `<`, `>`, `%`, `&`, `\`, `?`, `/` or control characters.
- Do not encode sensitive data (subscription ID, tenant ID) in names.
- Most names are **case-insensitive** in Azure — always compare case-insensitively.
- Resources with public endpoints cannot include reserved words or trademarks.

---

## Naming Scope

| Scope | Meaning |
|-------|---------|
| **Global** | Unique across all of Azure (PaaS with public endpoints) |
| **Resource group** | Unique within the resource group |
| **Resource** | Unique within the parent resource |

---

## Official Abbreviations and Naming Rules

### Management and Governance

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| Management group | `mg` | tenant | 1-90 | Alphanumerics, hyphens, underscores, periods, parentheses | `mg-platform-prod` |
| Resource group | `rg` | subscription | 1-90 | Underscores, hyphens, periods, parentheses, letters, digits | `rg-navigator-prod` |
| Log Analytics workspace | `log` | resource group | 4-63 | Alphanumerics and hyphens | `log-navigator-prod-001` |
| Application Insights | `appi` | resource group | 1-260 | Can't use: `%&\?/` | `appi-navigator-prod-001` |
| Automation account | `aa` | resource group + region | 6-50 | Alphanumerics and hyphens, start with letter | `aa-navigator-prod-001` |

### Networking

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| Virtual network | `vnet` | resource group | 2-64 | Alphanumerics, underscores, periods, hyphens | `vnet-shared-eastus2-001` |
| Subnet | `snet` | virtual network | 1-80 | Alphanumerics, underscores, periods, hyphens | `snet-shared-eastus2-001` |
| Network security group | `nsg` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `nsg-weballow-001` |
| Application security group | `asg` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `asg-navigator-prod-001` |
| Network interface | `nic` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `nic-01-vmnavigator-prod-001` |
| Public IP address | `pip` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `pip-navigator-prod-westus-001` |
| Load balancer (internal) | `lbi` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `lbi-navigator-prod-001` |
| Load balancer (external) | `lbe` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `lbe-navigator-prod-001` |
| Application gateway | `agw` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `agw-navigator-prod-001` |
| Firewall | `afw` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `afw-navigator-prod-001` |
| Firewall policy | `afwp` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `afwp-navigator-prod-001` |
| Route table | `rt` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `rt-navigator-prod-001` |
| Virtual network gateway | `vgw` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `vgw-shared-eastus2-001` |
| VPN Gateway | `vpng` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `vpng-navigator-prod-001` |
| Azure Bastion | `bas` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `bas-navigator-prod-001` |
| Private endpoint | `pep` | resource group | 2-64 | Alphanumerics, underscores, periods, hyphens | `pep-navigator-prod-001` |
| Traffic Manager profile | `traf` | global | 1-63 | Alphanumerics and hyphens (no periods) | `traf-navigator-prod` |
| ExpressRoute circuit | `erc` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `erc-navigator-prod-001` |
| CDN profile | `cdnp` | resource group | 1-260 | Alphanumerics and hyphens | `cdnp-navigator-prod-001` |
| Front Door profile | `afd` | resource group | 5-64 | Alphanumerics and hyphens | `afd-navigator-prod` |

### Compute and Web

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| Virtual machine | `vm` | resource group | 1-15 (Windows) / 1-64 (Linux) | No spaces or: `~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \| ; : . ' " , < > / ?` | `vm-sql-test-001` |
| VM scale set | `vmss` | resource group | 1-15 (Windows) / 1-64 (Linux) | Same as VM | `vmss-navigator-prod-001` |
| Availability set | `avail` | resource group | 1-80 | Alphanumerics, underscores, periods, hyphens | `avail-navigator-prod-001` |
| App Service plan | `asp` | resource group | 1-60 | Alphanumeric, hyphens, Unicode | `asp-navigator-prod-001` |
| Web app | `app` | global | 2-60 | Alphanumeric, hyphens, Unicode. Can't start/end with hyphen. | `app-navigator-prod-001` |
| Function app | `func` | global | 2-60 | Alphanumeric, hyphens, Unicode. Can't start/end with hyphen. | `func-navigator-prod-001` |
| Static web app | `stapp` | resource group | — | — | `stapp-navigator-prod-001` |
| App Service environment | `ase` | resource group | — | — | `ase-navigator-prod-001` |

### Containers

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| AKS cluster | `aks` | resource group | 1-63 | Alphanumerics, underscores, hyphens | `aks-navigator-prod-001` |
| AKS system node pool | `npsystem` | managed cluster | 1-12 (Linux) / 1-6 (Windows) | Lowercase letters and numbers, can't start with number | `npsystem` |
| AKS user node pool | `np` | managed cluster | 1-12 (Linux) / 1-6 (Windows) | Lowercase letters and numbers, can't start with number | `npusers` |
| Container apps | `ca` | resource group | 2-32 | Lowercase letters, numbers, hyphens. Start with letter, end with alphanumeric. | `ca-navigator-prod-001` |
| Container apps environment | `cae` | resource group | — | — | `cae-navigator-prod-001` |
| Container instance | `ci` | resource group | 1-63 | Lowercase letters, numbers, hyphens. Can't start/end with hyphen. | `ci-navigator-prod-001` |
| Container registry | `cr` | global | 5-50 | **Alphanumerics only — no hyphens** | `crnavigatorprod001` |

### Databases

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| Azure SQL server | `sql` | global | 1-63 | Lowercase letters, numbers, hyphens. Can't start/end with hyphen. | `sql-navigator-prod-001` |
| Azure SQL database | `sqldb` | SQL server | 1-128 | Can't use: `<>*%&:\/?` | `sqldb-navigator-prod` |
| SQL Managed Instance | `sqlmi` | global | 1-63 | Lowercase letters, numbers, hyphens. Can't start/end with hyphen. | `sqlmi-navigator-prod-001` |
| Azure Cosmos DB | `cosmos` | global | 3-44 | Lowercase letters, numbers, hyphens. Start with lowercase letter or number. | `cosmos-navigator-prod` |
| Azure Managed Redis | `amr` | global | 1-63 | Alphanumerics and hyphens. Start/end with alphanumeric. | `amr-navigator-prod-001` |
| MySQL server | `mysql` | global | 3-63 | Lowercase letters, hyphens, numbers. Can't start/end with hyphen. | `mysql-navigator-prod-001` |
| PostgreSQL server | `psql` | global | 3-63 | Lowercase letters, hyphens, numbers. Can't start/end with hyphen. | `psql-navigator-prod-001` |

### Storage

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| Storage account | `st` | global | 3-24 | **Lowercase letters and numbers only — no hyphens** | `stnavigatorprod001` |
| Backup vault | `bvault` | resource group | 2-50 | Alphanumerics and hyphens. Start with a letter. | `bvault-navigator-prod-001` |

### Security

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| Key vault | `kv` | global | 3-24 | Alphanumerics and hyphens. Start with letter, end with letter or number. No consecutive hyphens. | `kv-navigator-prod-001` |
| Managed identity | `id` | resource group | 3-128 | Alphanumerics, hyphens, underscores. Start with letter or number. | `id-navigator-prod-001` |

### Integration

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| API Management | `apim` | global | 1-50 | Alphanumerics and hyphens. Start with letter, end with alphanumeric. | `apim-navigator-prod` |
| Service Bus namespace | `sbns` | global | 6-50 | Alphanumerics and hyphens. Start with letter, end with letter or number. | `sbns-navigator-prod` |
| Service Bus queue | `sbq` | Service Bus | 1-260 | Alphanumerics, periods, hyphens, underscores, slashes | `sbq-navigator` |
| Service Bus topic | `sbt` | Service Bus | 1-260 | Alphanumerics, periods, hyphens, underscores, slashes | `sbt-navigator` |
| Event Hubs namespace | `evhns` | global | 6-50 | Alphanumerics and hyphens. Start with letter, end with letter or number. | `evhns-navigator-prod` |
| Event hub | `evh` | Event Hubs namespace | 1-256 | Alphanumerics, periods, hyphens, underscores | `evh-navigator` |
| Logic app | `logic` | resource group | 1-43 | Alphanumerics, hyphens, underscores, periods | `logic-navigator-prod-001` |

### AI and Machine Learning

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| Azure OpenAI Service | `oai` | resource group | 2-64 | Alphanumerics and hyphens | `oai-navigator-prod` |
| AI Search | `srch` | global | — | — | `srch-navigator-prod` |
| Azure ML workspace | `mlw` | resource group | 3-33 | Alphanumerics, hyphens, underscores | `mlw-navigator-prod` |
| Foundry hub | `hub` | resource group | 3-33 | Alphanumerics, hyphens, underscores | `hub-navigator-prod` |
| Foundry hub project | `proj` | Foundry hub | 3-33 | Alphanumerics, hyphens, underscores | `proj-navigator-prod` |
| Foundry account | `aif` | resource group | 2-64 | Alphanumerics and hyphens | `aif-navigator-prod` |
| Foundry account project | `proj` | Foundry account | — | — | `proj-navigator-prod` |
| Foundry Tools (multi-service) | `ais` | resource group | 2-64 | Alphanumerics and hyphens | `ais-navigator-prod` |

### Analytics and IoT

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| Azure Data Factory | `adf` | global | 3-63 | Alphanumerics and hyphens. Start/end with alphanumeric. | `adf-navigator-prod` |
| Azure Databricks workspace | `dbw` | resource group | 3-64 | Alphanumerics, underscores, hyphens | `dbw-navigator-prod-001` |
| Azure Data Explorer cluster | `dec` | global | 4-22 | Lowercase letters and numbers. Start with a letter. | `decnavigatorprod` |
| Azure Synapse workspace | `synw` | global | 1-50 | Lowercase letters, hyphens, numbers. Start/end with letter or number. | `synw-navigator-prod` |
| IoT hub | `iot` | global | 3-50 | Alphanumerics and hyphens. Can't end with hyphen. | `iot-navigator-prod` |
| Event Grid topic | `evgt` | region | 3-50 | Alphanumerics and hyphens | `evgt-navigator-prod` |

### Developer Tools

| Resource | Abbr | Scope | Length | Valid Characters | Example |
|----------|------|-------|--------|-----------------|---------|
| App Configuration store | `appcs` | global | 5-50 | Alphanumerics and hyphens. No more than two consecutive hyphens. | `appcs-navigator-prod` |
| SignalR | `sigr` | global | 3-63 | Alphanumerics and hyphens. Start with letter, end with letter or number. | `sigr-navigator-prod` |

---

## Resources That Do NOT Allow Hyphens

These resources require concatenated lowercase alphanumerics (no separators):

| Resource | Abbr | Pattern |
|----------|------|---------|
| Storage account | `st` | `st{workload}{env}{instance}` → `stnavigatorprod001` |
| Container registry | `cr` | `cr{workload}{env}{instance}` → `crnavigatorprod001` |
| Azure Data Explorer cluster | `dec` | `dec{workload}{env}` → `decnavigatorprod` |

---

## Examples (CAF)

```
# Management
rg-navigator-prod
rg-webapp-database-dev

# Networking
vnet-shared-eastus2-001
snet-shared-eastus2-001
nsg-weballow-001
pip-dc1-shared-eastus2-001
lbe-navigator-prod-001

# Compute
vm-sql-test-001
vm-sharepoint-dev-001
vmss-navigator-prod-001
asp-navigator-prod-001
app-navigator-prod-001
func-navigator-prod-001

# Containers
aks-navigator-prod-001
ca-navigator-prod-001
cae-navigator-prod-001
crnavigatorprod001        # no hyphens!

# Databases
sql-navigator-prod-001
sqldb-navigator-prod
cosmos-navigator-prod
psql-navigator-prod-001

# Storage / Security
stnavigatorprod001        # no hyphens!
kv-navigator-prod-001
id-navigator-prod-001

# Integration
apim-navigator-prod
sbns-navigator-prod
evhns-navigator-prod

# Monitoring
log-navigator-prod-001
appi-navigator-prod-001

# AI
oai-navigator-prod
srch-navigator-prod
```

---

## Do NOT Do

- Do not use underscores unless the resource type requires it — use hyphens.
- Do not spell out the full resource type word (e.g., `storageaccount-myapp` → use `stmyapp001`).
- Do not use uppercase letters (resources are case-insensitive; lowercase is the convention).
- Do not include sensitive data (subscription ID, tenant ID, passwords) in names.
- Do not skip the environment segment — even for production.
- Do not use `#` — it breaks URL parsing in Azure Resource Manager.
- Do not use reserved words or trademarks in names for resources with public endpoints.
- Do not use more than two consecutive hyphens (e.g., `app--prod` is invalid).

© github · MIT · github/awesome-copilot

Similar IDE rules

All IDE rules for Cloud: AWS, Azure, GCP →

From the same set770

The whole set →
centos-linux This rule guides CentOS administration, package work, systemd, firewalld, and SELinux. Use it when Copilot writes commands, scripts, or docs for CentOS. ★ 40,418repo stars blazor Guides GitHub Copilot on Razor component structure, C# 14 features, caching, and state management in Blazor applications. ★ 40,418repo stars bicep-code-best-practices This rule guides GitHub Copilot when editing Bicep files, covering naming, parameters, resource references, and outputs. Use it to keep infrastructure code consistent with the stated conventions. ★ 40,418repo stars azure-verified-modules-bicep Instructs GitHub Copilot to use Azure Verified Modules when writing Bicep templates. It enforces AVM registry modules over raw Azure resource declarations. ★ 40,418repo stars azure-logic-apps-power-automate A GitHub Copilot rule that guides JSON workflow definitions for Azure Logic Apps and Power Automate: triggers, actions, error handling. ★ 40,418repo stars azure-iot-edge-architecture Requires reviewing Azure IoT Edge documentation before proposing architectures. It targets Bicep, Terraform, and edge-related markdown files. ★ 40,418repo stars azure-functions-typescript This rule guides Copilot when generating TypeScript APIs for Azure Functions, including async code and endpoint file layout. It also calls for updating the OpenAPI schema and README.md when the API changes. ★ 40,418repo stars azure-functions-csharp A GitHub Copilot rule that sets conventions for building Azure Functions in C# with the isolated worker model. Useful when you want consistent style across a functions project. ★ 40,418repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor