Skip to content

Commit e0c82a2

Browse files
author
Delora Bradish
committed
changed H3s to be numbered lists
1 parent 66f33f5 commit e0c82a2

File tree

1 file changed

+62
-64
lines changed

1 file changed

+62
-64
lines changed

articles/notification-hubs/create-notification-hub-azure-cli.md

Lines changed: 62 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -30,101 +30,99 @@ Notification Hubs requires version 2.0.67 or later of the Azure CLI. Run `az --v
3030

3131
## Prepare your environment
3232

33-
### Sign in
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.
3434

35-
Sign in using the [az login](/cli/azure/reference-index#az-login) command if you're using a local install of the CLI.
35+
```azurecli-interactive
36+
az login
37+
```
3638
37-
```azurecli-interactive
38-
az login
39-
```
39+
Follow the steps displayed in your terminal to complete the authentication process.
4040
41-
Follow the steps displayed in your terminal to complete the authentication process.
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).
4242
43-
### Install notification hubs extension
43+
```azurecli-interactive
44+
az extension add --name notification-hub
45+
```
4446

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).
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.
4648

47-
```azurecli-interactive
48-
az extension add --name notification-hub
49-
```
49+
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:
5050

51-
### Create a resource group
51+
```azurecli-interactive
52+
az group create --name spnhubrg --location eastus
53+
```
5254

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.
55+
## Create a namespace
5456

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:
57+
1. Create a notification hub namespace.
58+
59+
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.
5660

57-
```azurecli-interactive
58-
az group create --name spnhubrg --location eastus
59-
```
61+
```azurecli-interactive
62+
#check availability
63+
az notification-hub namespace check-availability --name spnhubns
64+
65+
#create the namespace
66+
az notification-hub namespace create --resource-group spnhubrg --name spnhubns --location eastus --sku Free
67+
```
6068

61-
## Create a notification hub namespace
69+
2. List keys and connection strings for a namespace access policy
6270

63-
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.
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.
6472

65-
```azurecli-interactive
66-
#check availability
67-
az notification-hub namespace check-availability --name spnhubns
68-
69-
#create the namespace
70-
az notification-hub namespace create --resource-group spnhubrg --name spnhubns --location eastus --sku Free
71-
```
72-
73-
### List keys and connection strings for a namespace access policy
74-
75-
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.
76-
77-
```azurecli-interactive
78-
az notification-hub namespace authorization-rule list-keys --resource-group spnhubrg --namespace-name spnhubns --name RootManageSharedAccessKey
79-
```
73+
```azurecli-interactive
74+
az notification-hub namespace authorization-rule list-keys --resource-group spnhubrg --namespace-name spnhubns --name RootManageSharedAccessKey
75+
```
8076

8177
## Create a notification hub
8278

83-
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.
79+
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.
8480

85-
```azurecli-interactive
86-
az notification-hub create --resource-group spnhubrg --namespace-name spnhubns --name spfcmtutorial1nhub --location eastus --sku Free
87-
```
81+
```azurecli-interactive
82+
az notification-hub create --resource-group spnhubrg --namespace-name spnhubns --name spfcmtutorial1nhub --location eastus --sku Free
83+
```
8884

89-
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.
85+
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.
9086

91-
```azurecli-interactive
92-
az notification-hub create --resource-group spnhubrg --namespace-name spnhubns --name mysecondnhub --location eastus --sku Free
93-
```
87+
```azurecli-interactive
88+
az notification-hub create --resource-group spnhubrg --namespace-name spnhubns --name mysecondnhub --location eastus --sku Free
89+
```
9490

95-
### Create a new authorization-rule for a notification hub
91+
## Work with access policies
9692

97-
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.
93+
1. Create a new authorization-rule for a notification hub
9894

99-
```azurecli-interactive
100-
az notification-hub authorization-rule create --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --name spnhub1key --rights Listen,Send
101-
```
95+
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.
10296

103-
### List access policies for a notification hub
97+
```azurecli-interactive
98+
az notification-hub authorization-rule create --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --name spnhub1key --rights Listen Send
99+
```
104100

105-
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.
101+
2. List access policies for a notification hub
106102

107-
```azurecli-interactive
108-
az notification-hub authorization-rule list --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --output table
109-
```
103+
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.
110104

111-
> [!IMPORTANT]
112-
> Do not use the **DefaultFullSharedAccessSignature** policy in your application. This is meant to be used in your app backend only.
105+
```azurecli-interactive
106+
az notification-hub authorization-rule list --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --output table
107+
```
113108

114-
### List keys and connection strings for a notification hub access policy
109+
> [!IMPORTANT]
110+
> Do not use the **DefaultFullSharedAccessSignature** policy in your application. This is meant to be used in your app backend only.
115111
116-
There are two sets of keys and connection strings for each access policy. You'll need them later to handle push notifications. To list the keys and connections strings for a notification hub access policy, use the [az notification-hub authorization-rule list-keys](/cli/azure/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-az-notification-hub-authorization-rule-list-keys) command.
112+
3. List keys and connection strings for a notification hub access policy
117113

118-
```azurecli-interactive
119-
#query the keys and connection strings for DefaultListenSharedAccessSignature
120-
az notification-hub authorization-rule list-keys --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --name DefaultListenSharedAccessSignature --output json
114+
There are two sets of keys and connection strings for each access policy. You'll need them later to handle push notifications. To list the keys and connections strings for a notification hub access policy, use the [az notification-hub authorization-rule list-keys](/cli/azure/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-az-notification-hub-authorization-rule-list-keys) command.
121115

122-
#query the keys and connection strings for the custom policy
123-
az notification-hub authorization-rule list-keys --resource-group spnhubrg --namespace-name spnhubns2 --notification-hub-name spfcmtutorial1nhub --name spnhub1key --output json
124-
```
116+
```azurecli-interactive
117+
#query the keys and connection strings for DefaultListenSharedAccessSignature
118+
az notification-hub authorization-rule list-keys --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --name DefaultListenSharedAccessSignature --output json
119+
120+
#query the keys and connection strings for the custom policy
121+
az notification-hub authorization-rule list-keys --resource-group spnhubrg --namespace-name spnhubns2 --notification-hub-name spfcmtutorial1nhub --name spnhub1key --output json
122+
```
125123

126-
> [!NOTE]
127-
> A [notification hub namespace](/cli/azure/ext/notification-hub/notification-hub/namespace/authorization-rule#ext-notification-hub-az-notification-hub-namespace-authorization-rule-list-keys) and a [notification hub](/cli/azure/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-az-notification-hub-authorization-rule-list-keys) have separate access policies. Make sure you are using the correct Azure CLI reference when querying for keys and connection strings.
124+
> [!NOTE]
125+
> A [notification hub namespace](/cli/azure/ext/notification-hub/notification-hub/namespace/authorization-rule#ext-notification-hub-az-notification-hub-namespace-authorization-rule-list-keys) and a [notification hub](/cli/azure/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-az-notification-hub-authorization-rule-list-keys) have separate access policies. Make sure you are using the correct Azure CLI reference when querying for keys and connection strings.
128126
129127
## Clean up resources
130128

0 commit comments

Comments
 (0)