Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 6, 2025

PR Summary

This PR implements 27 new naming format rules for Azure resources to help enforce Cloud Adoption Framework (CAF) naming conventions. These rules are part of the 2025_12 rule set and cover critical infrastructure services including AKS, Container Apps, Service Fabric, Cosmos DB, Redis, and SQL databases.

Changes

New Rules (AZR-000498 to AZR-000529)

Kubernetes & Container Services:

  • Azure.AKS.Naming - AKS cluster naming convention
  • Azure.AKS.SystemPoolNaming - AKS system node pool naming convention
  • Azure.AKS.UserPoolNaming - AKS user node pool naming convention
  • Azure.ContainerApp.Naming - Container Apps naming convention
  • Azure.ContainerApp.EnvironmentNaming - Container Apps environment naming convention
  • Azure.ContainerApp.JobNaming - Container Apps job naming convention
  • Azure.ACR.Naming - Container Registry naming convention
  • Azure.CI.Naming - Container Instance naming convention

Service Fabric:

  • Azure.ServiceFabric.Naming - Service Fabric cluster naming convention
  • Azure.ServiceFabric.ManagedNaming - Service Fabric managed cluster naming convention

Database Services:

  • Azure.Cosmos.CassandraNaming - Cosmos DB for Apache Cassandra naming convention
  • Azure.Cosmos.MongoNaming - Cosmos DB for MongoDB naming convention
  • Azure.Cosmos.NoSQLNaming - Cosmos DB for NoSQL naming convention
  • Azure.Cosmos.TableNaming - Cosmos DB for Table naming convention
  • Azure.Cosmos.GremlinNaming - Cosmos DB for Apache Gremlin naming convention
  • Azure.Cosmos.PostgreSQLNaming - Cosmos DB PostgreSQL cluster naming convention
  • Azure.Cosmos.DatabaseNaming - Cosmos DB database naming convention
  • Azure.Redis.Naming - Azure Cache for Redis naming convention
  • Azure.RedisEnterprise.Naming - Azure Managed Redis naming convention
  • Azure.SQL.ServerNaming - Azure SQL Database server naming convention
  • Azure.SQL.DatabaseNaming - Azure SQL database naming convention
  • Azure.SQL.JobAgentNaming - Azure SQL Elastic Job agent naming convention
  • Azure.SQL.ElasticPoolNaming - Azure SQL Elastic Pool naming convention
  • Azure.SQL.StretchDBNaming - SQL Server Stretch Database naming convention
  • Azure.SQLMI.Naming - SQL Managed Instance naming convention
  • Azure.MySQL.Naming - MySQL database naming convention
  • Azure.PostgreSQL.Naming - PostgreSQL database naming convention

Configuration

Added a new Azure.CAF_2025_12 baseline with recommended naming prefixes aligned to CAF best practices:

  • aks- for AKS clusters
  • npsystem for AKS system node pools
  • np for AKS user node pools
  • ca-, cae-, caj- for Container Apps resources
  • cr for Container Registry
  • ci- for Container Instances
  • sf-, sfmc- for Service Fabric clusters
  • coscas-, cosmon-, cosno-, costab-, cosgrm- for Cosmos DB accounts
  • cospos- for Cosmos DB PostgreSQL
  • cosmos- for Cosmos DB databases
  • redis-, amr- for Redis instances
  • sql-, sqldb-, sqlja-, sqlep-, sqlstrdb-, sqlmi- for SQL resources
  • mysql-, psql- for MySQL and PostgreSQL

Documentation

  • Updated docs/setup/setup-naming-and-tagging.md with comprehensive table of all naming rules
  • Created complete rule documentation for all 27 rules with Bicep and ARM template examples
  • All Cosmos DB naming rules include comprehensive deployment examples with proper resource configurations, capabilities, backup policies, and zone redundancy settings
  • Added changelog entry summarizing the new rules
  • All rules include Azure.WAF/maturity label set to L2 and link to Operational Excellence maturity model

Testing

Comprehensive test coverage includes:

  • Tests for AKS naming rules in Azure.AKS.Tests.ps1
  • Tests for Container App naming rules in Azure.ContainerApp.Tests.ps1
  • Tests for Container Registry naming in Azure.ACR.Tests.ps1
  • Tests for Container Instance naming in Azure.CI.Tests.ps1
  • Tests for Service Fabric naming in Azure.ServiceFabric.Tests.ps1
  • Tests for Cosmos DB naming rules in Azure.Cosmos.Tests.ps1
  • Tests for Redis naming in Azure.Redis.Tests.ps1
  • Tests for SQL naming rules in Azure.SQL.Tests.ps1
  • Tests for MySQL naming in Azure.MySQL.Tests.ps1
  • Tests for PostgreSQL naming in Azure.PostgreSQL.Tests.ps1
  • Tests for SQL MI naming in Azure.SQLMI.Tests.ps1

All tests verify proper validation of both valid and invalid resource names based on configured regex patterns.

Usage Example

configuration:
  # Configure naming format for AKS cluster
  AZURE_AKS_CLUSTER_NAME_FORMAT: '^aks-'
  
  # Configure naming format for Container Apps
  AZURE_CONTAINER_APP_NAME_FORMAT: '^ca-'
  
  # Configure naming format for Cosmos DB NoSQL accounts
  AZURE_COSMOS_NOSQL_NAME_FORMAT: '^cosno-'
  
  # Configure naming format for SQL Server
  AZURE_SQL_SERVER_NAME_FORMAT: '^sql-'

Or adopt all CAF recommendations at once:

binding:
  preferTargetInfo: true

include:
  - Azure.CAF_2025_12

PR Checklist

  • PR has a meaningful title
  • Summarized changes
  • Change is not breaking
  • This PR is ready to merge and is not Work in Progress
  • Rule changes
    • Unit tests created/ updated
    • Rule documentation created/ updated
    • Link to a filed issue
    • Change log has been updated with change under unreleased section

Fixes #3548

Original prompt

This section details on the original issue you should resolve

<issue_title>[RULE] Add new naming format rules</issue_title>
<issue_description>### Existing rule

No response

Suggested rule

Added additional CAF naming rules that check the naming format of resources.

When implementing the rule use and update the following documentation in addition to the normal requirements for rules.

  • docs/setup/setup-naming-and-tagging.md
  • docs/setup/configuring-rules.md

Some examples of existing rules include:

  • Azure.AI.FoundryNaming
  • Azure.AppInsights.Naming
  • Azure.LB.Naming

These new rules will need tests and will be added to the 2025_12 rule set.

Add new naming format rules for the following resource types:

Resource Resource provider namespace Abbreviation
AKS cluster Microsoft.ContainerService/managedClusters aks
AKS system node pool Microsoft.ContainerService/managedClusters/agentPools (mode: System) npsystem
AKS user node pool Microsoft.ContainerService/managedClusters/agentPools (mode: User) np
Container apps Microsoft.App/containerApps ca
Container apps environment Microsoft.App/managedEnvironments cae
Container apps job Microsoft.App/jobs caj
Container registry Microsoft.ContainerRegistry/registries cr
Container instance Microsoft.ContainerInstance/containerGroups ci
Service Fabric cluster Microsoft.ServiceFabric/clusters sf
Service Fabric managed cluster Microsoft.ServiceFabric/managedClusters sfmc
Azure Cosmos DB for Apache Cassandra account Microsoft.DocumentDB/databaseAccounts coscas
Azure Cosmos DB for MongoDB account Microsoft.DocumentDB/databaseAccounts cosmon
Azure Cosmos DB for NoSQL account Microsoft.DocumentDb/databaseAccounts cosno
Azure Cosmos DB for Table account Microsoft.DocumentDb/databaseAccounts costab
Azure Cosmos DB for Apache Gremlin account Microsoft.DocumentDb/databaseAccounts cosgrm
Azure Cosmos DB PostgreSQL cluster Microsoft.DBforPostgreSQL/serverGroupsv2 cospos
Azure Cache for Redis instance Microsoft.Cache/Redis redis
Azure Managed Redis Microsoft.Cache/RedisEnterprise amr
Azure SQL Database server Microsoft.Sql/servers sql
Azure SQL database Microsoft.Sql/servers/databases sqldb
Azure SQL Elastic Job agent Microsoft.Sql/servers/jobAgents sqlja
Azure SQL Elastic Pool Microsoft.Sql/servers/elasticpool sqlep
MySQL database Microsoft.DBforMySQL/servers mysql
PostgreSQL database Microsoft.DBforPostgreSQL/servers psql
SQL Server Stretch Database Microsoft.Sql/servers/databases sqlstrdb
SQL Managed Instance Microsoft.Sql/managedInstances sqlmi
Azure Cosmos DB database Microsoft.DocumentDB/databaseAccounts/sqlDatabases cosmos

Pillar

Operational Excellence

Additional context

No response</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #3548

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits October 6, 2025 05:30
…ure services

Co-authored-by: BernieWhite <13513058+BernieWhite@users.noreply.github.com>
Co-authored-by: BernieWhite <13513058+BernieWhite@users.noreply.github.com>
Co-authored-by: BernieWhite <13513058+BernieWhite@users.noreply.github.com>
Co-authored-by: BernieWhite <13513058+BernieWhite@users.noreply.github.com>
Copilot AI changed the title [WIP] [RULE] Add new naming format rules Add naming format rules for containers, databases and infrastructure services Oct 6, 2025
Copilot AI requested a review from BernieWhite October 6, 2025 05:40
Copy link
Collaborator

@BernieWhite BernieWhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I have provided some comments with fixes that are required.

Additionally, you need to create rule documentation for each rule. Use the following as examples:

  • docs/en/rules/Azure.AppInsights.Naming.md
  • docs/en/rules/Azure.EventGrid.DomainNaming.md

Copilot AI and others added 2 commits October 10, 2025 13:55
- Update AKS node pool naming rules to use GetAgentPoolProfiles for both inline and nested pools
- Move Redis Enterprise naming rule to separate Azure.RedisEnterprise.Rule.ps1 file
- Convert Service Fabric naming rules from YAML to PowerShell
- Distribute tests from Azure.NamingRules.Tests.ps1 to individual service test files
- Delete consolidated Azure.NamingRules.Tests.ps1 file

Co-authored-by: BernieWhite <13513058+BernieWhite@users.noreply.github.com>
Created comprehensive markdown documentation for:
- AKS cluster and node pools (3 rules)
- Container resources: ACR, CI, Container Apps (5 rules)
- Service Fabric clusters (2 rules)
- Cosmos DB accounts and databases (7 rules)
- Redis instances (2 rules)
- SQL and database servers (8 rules)

Each documentation file includes:
- Synopsis and description
- CAF naming recommendations
- Configuration examples
- Bicep/ARM template examples
- Links to relevant Azure documentation

Co-authored-by: BernieWhite <13513058+BernieWhite@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 10, 2025

@copilot I have provided some comments with fixes that are required.

Additionally, you need to create rule documentation for each rule. Use the following as examples:...

All feedback addressed:

  1. Rule refactoring (commit fd7291f):

    • AKS node pool naming rules now use GetAgentPoolProfiles
    • Redis Enterprise rule moved to separate file
    • Service Fabric naming rules converted from YAML to PowerShell
    • Tests distributed to individual service test files
  2. Rule documentation (commit 8497b42):

    • Created markdown documentation for all 27 rules
    • Each file follows the same structure as Azure.AppInsights.Naming.md and Azure.EventGrid.DomainNaming.md
    • Includes synopsis, description, CAF recommendations, configuration examples, and Azure doc links

All changes are now complete and ready for review.

@BernieWhite
Copy link
Collaborator

@copilot Each of these naming rules should use the Azure.WAF/maturity label set to L2. e.g. -Labels @{ 'Azure.WAF/maturity' = 'L1'; }.

Each rule documentation should also add an additional link to [Operational Excellence maturity model](https://learn.microsoft.com/azure/well-architected/operational-excellence/maturity-model?tabs=level2)

@BernieWhite
Copy link
Collaborator

This maturity level should be L2.

…ng rules

- Added Azure.WAF/maturity label set to L2 for all 27 naming rules across all rule files
- Updated all 27 rule documentation files to include link to Operational Excellence maturity model
- Changes apply to: AKS, Container Apps, Container Registry, Container Instances, Service Fabric, Cosmos DB, Redis, SQL, MySQL, PostgreSQL, and SQL MI naming rules

Co-authored-by: BernieWhite <13513058+BernieWhite@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 11, 2025

@copilot Each of these naming rules should use the Azure.WAF/maturity label set to L2. e.g. -Labels @{ 'Azure.WAF/maturity' = 'L1'; }.

Each rule documentation should also add an additional li...

Done in commit (will be shown after push). Added Azure.WAF/maturity label set to L2 to all 27 naming rules and included the Operational Excellence maturity model link in all rule documentation files.

@BernieWhite
Copy link
Collaborator

@copilot add Bicep and arm template examples for the cosmos db rules.

- Added complete Bicep and ARM template examples to Azure.Cosmos.CassandraNaming.md
- Added complete Bicep and ARM template examples to Azure.Cosmos.MongoNaming.md
- Added complete Bicep and ARM template examples to Azure.Cosmos.TableNaming.md
- Added complete Bicep and ARM template examples to Azure.Cosmos.DatabaseNaming.md
- Added complete Bicep and ARM template examples to Azure.Cosmos.PostgreSQLNaming.md
- Examples include proper resource configuration, capabilities, backup policies, and zone redundancy settings

Co-authored-by: BernieWhite <13513058+BernieWhite@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 24, 2025

@copilot add Bicep and arm template examples for the cosmos db rules.

Added Bicep and ARM template examples to all 5 Cosmos DB naming rules in commit (will show after push). Examples include proper resource configurations for Cassandra, MongoDB, Table, Database (sqlDatabases), and PostgreSQL (serverGroupsv2) with zone redundancy, backup policies, and TLS settings.

@BernieWhite BernieWhite marked this pull request as ready for review November 27, 2025 14:20
@BernieWhite BernieWhite requested a review from a team as a code owner November 27, 2025 14:20
@BernieWhite BernieWhite merged commit 76c88e4 into main Nov 27, 2025
14 checks passed
@BernieWhite BernieWhite deleted the copilot/fix-cde04a13-3f4f-4391-bdb3-6e9fc77b7cf5 branch November 27, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RULE] Add new naming format rules

2 participants