Service Bus namespace does not support double hyphen

David Tang 20 Reputation points
2024-08-28T10:34:46.9+00:00

Following Microsoft's resource naming restriction, I tried to create a Service Bus namespace with double hyphen. However it is returned as invalid. I tried both az-cli and azure web portal.

On Azure web portal, the name "ai-stag-atlantic--bus-ejp-b" passed several validations and review but got returned as error at the deployment:

Namespace name 'ai-stag-atlantic--bus-ejp-g' is not available. Reason: InvalidName. Message: Invalid namespace name (Code: NamespaceUnavailable)

On command line:

❯ az servicebus namespace create --name ai-stag-atlantic--bus-ejp-b --location japaneast --sku Standard

(NamespaceUnavailable) Namespace name 'ai-stag-atlantic--bus-ejp-b' is not available. Reason: InvalidName. Message: Invalid namespace name

Did I read the docs wrong? Or could it be some bug in Azure's Service Bus naming validation?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
635 questions
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 27,916 Reputation points
    2024-08-30T03:30:43.24+00:00

    @David Tang I had a discussion with my team internally and they confirmed that namespace names map to subdomain names. RFC5890 2.3.1 reserves the 3rd and 4th position of a name having “-“ as special-cased

    consecutive hyphens are special for domain names, and the IETF having picked the double-hyphen as an “escape code” as late as 2010 (relative to the age of DNS) put up a red flag to stay away from it.

    so, we explicitly blocked double hyphens specifically to avoid users being able to create “international domain names” that could be used to spoof namespace names when shown to users through tools that translate punycode.

    Therefore, it is recommended to avoid using consecutive hyphens in namespace names to prevent spoofing of namespace names.

    do let me know incase of further queries, I would be happy to assist you.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.