You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/notification-hubs/create-notification-hub-azure-cli.md
+22-12Lines changed: 22 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,21 +30,27 @@ Notification Hubs requires version 2.0.67 or later of the Azure CLI. Run `az --v
30
30
31
31
## Prepare your environment
32
32
33
-
1. Sign in using the [az login](/cli/azure/reference-index#az-login) command if you're using a local install of the CLI.
33
+
1. Sign in.
34
+
35
+
Sign in using the [az login](/cli/azure/reference-index#az-login) command if you're using a local install of the CLI.
34
36
35
37
```azurecli-interactive
36
38
az login
37
39
```
38
40
39
41
Follow the steps displayed in your terminal to complete the authentication process.
40
42
41
-
2. To run the Azure CLI commands for notification hubs, install the Azure CLI [extension for Notification Hubs](/cli/azure/ext/notification-hub/notification-hub).
43
+
2. Install the Azure CLI extension.
44
+
45
+
To run the Azure CLI commands for notification hubs, install the Azure CLI [extension for Notification Hubs](/cli/azure/ext/notification-hub/notification-hub).
42
46
43
47
```azurecli-interactive
44
48
az extension add --name notification-hub
45
49
```
46
50
47
-
3. Azure notification hubs, like all Azure resources, must be deployed into a resource group. Resource groups allow you to organize and manage related Azure resources.
51
+
3. Create a resource group.
52
+
53
+
Azure notification hubs, like all Azure resources, must be deployed into a resource group. Resource groups allow you to organize and manage related Azure resources.
48
54
49
55
For this quickstart, create a resource group named *spnhubrg* in the *eastus* location with the following [az group create](/cli/azure/group#az-group-create) command:
50
56
@@ -55,50 +61,54 @@ Notification Hubs requires version 2.0.67 or later of the Azure CLI. Run `az --v
55
61
## Create a namespace
56
62
57
63
1. Create a notification hub namespace.
58
-
64
+
59
65
A namespace contains one or more hubs, and the name must be unique across all Azure subscriptions. To check the availability of the given service namespace, use the [az notification-hub namespace check-availability](/cli/azure/ext/notification-hub/notification-hub/namespace#ext-notification-hub-az-notification-hub-namespace-check-availability) command. Run the [az notification-hub namespace create](/cli/azure/ext/notification-hub/notification-hub/namespace#ext-notification-hub-az-notification-hub-namespace-create) command to create a namespace.
60
66
61
67
```azurecli-interactive
62
68
#check availability
63
69
az notification-hub namespace check-availability --name spnhubns
2. List keys and connection strings for a namespace access policy
75
+
2. List keys and connection strings for a namespace access policy.
70
76
71
-
An access policy is automatically created for a new namespace. There are two sets of keys and connection strings for each access policy. To list the keys and connection strings for the namespace, run the [az notification-hub namespace authorization-rule list-keys](/cli/azure/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-az-notification-hub-authorization-rule-list-keys) command.
77
+
An access policy named **RootManageSharedAccessKey**is automatically created for a new namespace. Every access policy has two sets of keys and connection strings. To list the keys and connection strings for the namespace, run the [az notification-hub namespace authorization-rule list-keys](/cli/azure/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-az-notification-hub-authorization-rule-list-keys) command.
1. A notification hub can now be created in the new namespace. Run the [az notification-hub create](/cli/azure/ext/notification-hub/notification-hub#ext-notification-hub-az-notification-hub-create) command to create a notification hub.
87
+
A notification hub can now be created in the new namespace. Run the [az notification-hub create](/cli/azure/ext/notification-hub/notification-hub#ext-notification-hub-az-notification-hub-create) command to create a notification hub.
Multiple notification hubs can be created in a single namespace. To create a second notification hub in the same namespace, run the `az notification-hub create` command again using a different hub name.
1. Create a new authorization-rule for a notification hub
103
+
1. Create a new authorization-rule for a notification hub.
94
104
95
105
An access policy is automatically created for each new notification hub. To create and customize your own access policy, use the [az notification-hub authorization-rule create](/cli/azure/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-az-notification-hub-authorization-rule-create) command.
To query what access policies exist for a notification hub, use the [az notification-hub authorization-rule list](/cli/azure/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-az-notification-hub-authorization-rule-list) command.
0 commit comments