4

I have tried to deploy an ARM template with new EventHub Namespace. But it is failing with the BadRequest error, The specified name isn't available.. But the name has not used previously in anything under that resource group. When I tried to create a similar resource manually from the portal it is working fine. So it should not be a privileges' issue. Can anyone suggest my issue here please?

{
    "type": "Microsoft.EventHub/namespaces",
    "apiVersion": "2021-11-01",
    "name": "xxxx-xxxx-xxx-000",
    "location": "[variables('location')]",
    "sku": {
        "name": "Standard",
        "tier": "Standard",
        "capacity": 1
    },
    "properties": {
        "isAutoInflateEnabled": false,
        "maximumThroughputUnits": 0
    }
}
Avilon
  • 121
  • 10
  • Could it be related to this [answer](https://stackoverflow.com/a/38301620/8742162) ? – Avilon Jul 21 '22 at 04:43
  • We need to add globaly unique name @Avilon with correct required format. Please check this [*MS DOC*](https://learn.microsoft.com/en-us/azure/templates/microsoft.eventhub/namespaces?tabs=json#property-values) once – AjayKumarGhose Jul 21 '22 at 05:36
  • Are you entering random numbers only ..!! – AjayKumarGhose Jul 21 '22 at 05:49
  • No I am entering a combination of letters for the part I put 'x' followed by '-000'. But It seems really doubtful if this name is used across azure. @AjayKumarGhose-MT – Avilon Jul 21 '22 at 05:54

1 Answers1

1

We have tried the same in our environment to create an eventhub namespace with name similar to yours and it works fine .

Below is the workaround we followed;

In the same name that we will be trying to deploy through ARM created in portal and then trying to deploy through ARM and got the same issue.

enter image description here

Yes its a known issue we can expect , To ensure that we need to provide the name which is globally unique and not by any resource group ,Not only at your resource group ,this name should not use anywhere(Azure) .

Make sure that if you have created it through portal and trying with ARM again , please delete the previous one if you are owner of that namespace. And try again with same name after deletion.

We have provided the namespace just similar to you to check whether this value is passed or not and it works successfully.

template.json

"resources": [
{
"type": "Microsoft.EventHub/namespaces",
"apiVersion": "2022-01-01-preview",
"name": "[parameters('namespaces_ajletter_test_111_something_name')]",
"location": "Central India",
"sku": {
"name": "Standard",
"tier": "Standard",
"capacity": 1
},

OUTPUT SCREENSHOT FOR REFERENCE:-

enter image description here enter image description here

For more information please refer the below links:-

AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15