Azure / Azure/azure-cli

Creating a Notification Hub fails.

Open
#20,960 2 comments 0 reactions 0 assignees View on GitHub
Notification Hub Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug
Azure CLI (both my local and cloud shell environment) fails to create a Notification Hubs resource. When deploying from the portal directly it doesn't seem to work either, the deployment doesn't fail, it just never deploys (waited over an hour).

**Command Name**
`az notification-hub create --resource-group reca-demo --namespace-name recahubns --name recahub --location uksouth`

**Errors:**
```
The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'name'
Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.31.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/local/Cellar/azure-cli/2.31.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
raise ex
File "/usr/local/Cellar/azure-cli/2.31.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/local/Cellar/azure-cli/2.31.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
result = cmd_copy(params)
File "/usr/local/Cellar/azure-cli/2.31.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/Cellar/azure-cli/2.31.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/Users/tom_titherington/.azure/cliextensions/notification-hub/azext_notification_hub/custom.py", line 142, in create_notificationhubs_hub
body.setdefault('sku', {})['name'] = namespace.sku.name
AttributeError: 'NoneType' object has no attribute 'name'
```

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- `az notification-hub namespace create --resource-group reca-demo --name recahubns --location uksouth --sku Free`

## Expected Behavior
The Notification Hub resource is created.
## Environment Summary
```
Linux-5.4.0-1065-azure-x86_64-with-debian-10.2 (Cloud Shell), Common Base Linux Delridge (quinault)
Python 3.6.10
Installer: DEB

azure-cli 2.32.0

Extensions:
db-up 0.2.6
notification-hub 0.2.0
ai-examples 0.2.5
ssh 1.0.0

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0
```
## Additional Context
What's odd is that most of the properties - in the response I get back when I create the Notification Hub Namespace - are null. Including the location, which I had literally just set in the create command. Here's the output:
```
{
"createdAt": null,
"critical": null,
"dataCenter": null,
"enabled": false,
"id": ,
"location": null,
"metricId": null,
"name": "recahubns",
"namespaceResourceName": null,
"namespaceType": null,
"provisioningState": "Unknown",
"region": null,
"resourceGroup": "reca-demo",
"scaleUnit": null,
"serviceBusEndpoint": null,
"sku": null,
"status": null,
"subscriptionId": null,
"tags": null,
"type": "Microsoft.NotificationHubs/namespaces",
"updatedAt": null
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.