Strange issue when creating a Service Bus namespace

Recently, I wanted to create a Service Bus namespace via Bicep.  The simplified resource looked like this:

resource serviceBus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' = {
  name: 'test-sb'
  location: resourceGroup().location
  sku: {
    name: 'Standard'
    tier: 'Standard'
  }
}

When I deployed the resource, I got this exception: The specified service namespace is invalid.  After 10 minutes troubleshooting, I decided to try to create a Service Bus namespace via the Azure portal.  There, I detected that the problem was related to the name that I’ve chosen.

In some obsolete documentation, I discovered that your Service Bus namespace name must not end with “-sb” or “-mgmt”.  Don’t ask me why 🙂

Hope this saves you some time!
Toon

ABOUT

MEET THE YOUR AZURE COACH TEAM

Your Azure Coach is specialized in organizing Azure trainings that are infused with real-life experience. All our coaches are active consultants, who are very passionate and who love to share their Azure expertise with you.