Azure Service Bus has various naming size limits and restrictions that developers need to consider when creating queues, topics, subscriptions, and other entities. Here’s an overview of the key naming size limits and restrictions
Namespace Length and Naming Restrictions
- Namespace Name length:
- The maximum length for a namespace name is 50 characters.
- The minimum length for a namespace name is 6 characters.
- Unique Global Namespace:
- Each Service Bus namespace name must be globally unique within Azure, similar to how a DNS name must be unique. This means you cannot have two namespaces with the same name across all Azure regions and subscriptions.
- Allowed Characters:
- Namespaces can include letters (uppercase and lowercase), numbers, and hyphens (-).
- Namespace Name Restrictions:
- The namespace name must start with a letter and end with a letter or number. Names that begin or end with a hyphen (-) are not allowed.
Queues and Topics Length and Naming Restrictions
- Name length:
- The maximum length for the names of queues and topics is 260 characters.
- The minimum length for a queue and topic name is 1 character.
- Unique inside a Namespace:
- Each Service Bus queue and topic name must be unique within an Azure Service Bus namespace.
- Allowed Characters:
- Queues and Topics can include lowercase letters, numbers, and hyphens (-).
- Note: Although the creation form allows you to add uppercase letters, all uppercase letters will be automatically converted to lowercase.
- Name Restrictions:
- The queue and topic name must start with a letter and end with a letter or number. Names that begin or end with a hyphen (-) are not allowed.
Topic Subscription Length and Naming Restrictions
- Name length:
- The maximum length for the names of topic subscriptions is 50 characters.
- The minimum length for a topic subscription name is 1 character.
- Unique inside a Topic:
- Each Service Bus Topic Subscription name must be unique within an Azure Service Bus Topic.
- Allowed Characters:
- Topic Subscriptions can include letters (uppercase and lowercase), numbers, and hyphens (-).
- Name Restrictions:
- The topic subscription name must start with a letter and end with a letter or number. Names that begin or end with a hyphen (-) are not allowed.
Topic Subscription Filter Length and Naming Restrictions
- Name length:
- The maximum length for the names of topic subscription filters is 260 characters.
- The minimum length for a topic subscription filter name is 1 character.
- Unique inside a Topic Subscription:
- Each topic subscription filter name must be unique within a Topic Subscription.
- Allowed Characters:
- Topic subscription filter can include letters (uppercase and lowercase), numbers, and hyphens (-).
- Name Restrictions:
- The topic subscription filter name must start with a letter and end with a letter or number. Names that begin or end with a hyphen (-) are not allowed.
- The value must match the expression ‘^[A-Za-z0-9]$|^[A-Za-z0-9][\w-\.\/\~]*[A-Za-z0-9]$’.
- The topic subscription filter name must start with a letter and end with a letter or number. Names that begin or end with a hyphen (-) are not allowed.
By adhering to these naming size limits and restrictions, developers can ensure that their Azure Service Bus resources are properly created and managed without running into issues related to naming conventions.
To lazy to read? We’ve got you covered! Check out our video version of this content!
Hope you find this helpful! If you enjoyed the content or found it useful and wish to support our efforts to create more, you can contribute towards purchasing a Star Wars Lego for my son!