Skip to content

Commit 473aa2d

Browse files
authored
Merge pull request #210476 from w-azure/winona-hub-create
Wrapping up the Create an IoT Hub section
2 parents 44866e4 + 1131efc commit 473aa2d

File tree

5 files changed

+72
-39
lines changed

5 files changed

+72
-39
lines changed

articles/iot-hub/iot-hub-create-through-portal.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ This article describes how to create and manage IoT hubs using the [Azure portal
2020

2121
[!INCLUDE [iot-hub-include-create-hub](../../includes/iot-hub-include-create-hub.md)]
2222

23-
## Change the settings of the IoT hub
23+
## Update the IoT hub
2424

25-
You can change the settings of an existing IoT hub after it's created from the IoT Hub pane. Here are some of the properties you can set for an IoT hub:
25+
You can change the settings of an existing IoT hub after it's created from the IoT Hub pane. Here are some properties you can set for an IoT hub:
2626

27-
**Pricing and scale**: You can use this property to migrate to a different tier or set the number of IoT Hub units.
27+
**Pricing and scale**: Migrate to a different tier or set the number of IoT Hub units.
2828

2929
**IP Filter**: Specify a range of IP addresses that will be accepted or rejected by the IoT hub.
3030

31-
**Properties**: Provides the list of properties that you can copy and use elsewhere, such as the resource ID, resource group, location, and so on.
31+
**Properties**: A list of properties that you can copy and use elsewhere, such as the resource ID, resource group, location, and so on.
32+
33+
For a complete list of options to update an IoT hub, see the [**az iot hub update** commands](/cli/azure/iot/hub#az-iot-hub-update) reference page.
3234

3335
### Shared access policies
3436

@@ -107,7 +109,9 @@ Here are two ways to find a specific IoT hub in your subscription:
107109

108110
## Delete the IoT hub
109111

110-
To delete an IoT hub, find the IoT hub you want to delete, then choose **Delete**.
112+
To delete an IoT hub, open your IoT hub in the Azure portal, then choose **Delete**.
113+
114+
:::image type="content" source="./media/iot-hub-create-through-portal/delete-iot-hub.png" alt-text="Screenshot showing where to find the delete button for an IoT hub in the Azure portal." lightbox="./media/iot-hub-create-through-portal/delete-iot-hub.png":::
111115

112116
## Next steps
113117

articles/iot-hub/iot-hub-create-use-iot-toolkit.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ This article shows you how to use the [Azure IoT Tools for Visual Studio Code](h
2121

2222
- [Visual Studio Code](https://code.visualstudio.com/)
2323

24-
- [Azure IoT Tools](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-tools) installed for Visual Studio Code.
24+
- [Azure IoT Tools](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-tools) installed for Visual Studio Code
25+
26+
- An Azure resource group: [create a resource group](/azure/azure-resource-manager/management/manage-resource-groups-portal#create-resource-groups) in the Azure portal
2527

2628
## Create an IoT hub without an IoT Project
2729

@@ -94,6 +96,9 @@ This method allows you to provision in VS Code without leaving your development
9496

9597
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/provision-done.png" alt-text="A screenshot that shows IoT Hub details in the output window in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/provision-done.png":::
9698

99+
> [!TIP]
100+
> To delete a device from your IoT hub, use the `Azure IoT Hub: Delete Device` option from the Command Palette. There is no option to delete your IoT hub in Visual Studio Code, however you can [delete your hub in the Azure portal](iot-hub-create-through-portal.md#delete-the-iot-hub).
101+
97102
## Next steps
98103

99104
Now that you've deployed an IoT hub using the Azure IoT Tools for Visual Studio Code, explore these articles:

articles/iot-hub/iot-hub-create-using-cli.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ This article shows you how to create an IoT hub using Azure CLI.
1717

1818
[!INCLUDE [azure-cli-prepare-your-environment.md](../../includes/azure-cli-prepare-your-environment.md)]
1919

20-
## Create an IoT Hub
21-
22-
Use the Azure CLI to create a resource group and then add an IoT hub.
23-
24-
1. When you create an IoT hub, you must create it in a resource group. Either use an existing resource group, or run the following [command to create a resource group](/cli/azure/resource):
20+
When you create an IoT hub, you must create it in a resource group. Either use an existing resource group, or run the following [command to create a resource group](/cli/azure/resource):
2521

2622
```azurecli-interactive
2723
az group create --name {your resource group name} --location westus
@@ -33,9 +29,12 @@ Use the Azure CLI to create a resource group and then add an IoT hub.
3329
> ```azurecli-interactive
3430
> az account list-locations -o table
3531
> ```
36-
>
3732
38-
2. Run the following [command to create an IoT hub](/cli/azure/iot/hub#az-iot-hub-create) in your resource group, using a globally unique name for your IoT hub:
33+
## Create an IoT Hub
34+
35+
Use the Azure CLI to create a resource group and then add an IoT hub.
36+
37+
Run the following [command to create an IoT hub](/cli/azure/iot/hub#az-iot-hub-create) in your resource group, using a globally unique name for your IoT hub:
3938
4039
```azurecli-interactive
4140
az iot hub create --name {your iot hub name} \
@@ -47,21 +46,43 @@ Use the Azure CLI to create a resource group and then add an IoT hub.
4746

4847
The previous command creates an IoT hub in the S1 pricing tier for which you're billed. For more information, see [Azure IoT Hub pricing](https://azure.microsoft.com/pricing/details/iot-hub/).
4948

50-
## Remove an IoT Hub
49+
For more information on Azure IoT Hub commands, see the [`az iot hub`](/cli/azure/iot/hub) reference article.
5150

52-
There are various commands to [delete an individual resource](/cli/azure/resource), such as an IoT hub, or delete a resource group and all its resources, including any IoT hubs.
51+
## Update the IoT hub
5352

54-
To [delete an IoT hub](/cli/azure/iot/hub#az-iot-hub-delete), run the following command:
53+
You can change the settings of an existing IoT hub after it's created. Here are some properties you can set for an IoT hub:
54+
55+
**Pricing and scale**: Migrate to a different tier or set the number of IoT Hub units.
56+
57+
**IP Filter**: Specify a range of IP addresses that will be accepted or rejected by the IoT hub.
58+
59+
**Properties**: A list of properties that you can copy and use elsewhere, such as the resource ID, resource group, location, and so on.
60+
61+
For a complete list of options to update an IoT hub, see the [**az iot hub update** commands](/cli/azure/iot/hub#az-iot-hub-update) reference page.
62+
63+
## Register a new device in the IoT hub
64+
65+
In this section, you create a device identity in the identity registry in your IoT hub. A device can't connect to a hub unless it has an entry in the identity registry. For more information, see [Understand the identity registry in your IoT hub](iot-hub-devguide-identity-registry.md). This device identity is [IoT Edge](/azure/iot-edge) enabled.
66+
67+
Run the following command to create a device identity. Use your IoT hub name and create a new device ID name in place of `{iothub_name}` and `{device_id}`. This command creates a device identity with default authorization (shared private key).
5568

5669
```azurecli-interactive
57-
az iot hub delete --name {your iot hub name} -\
58-
-resource-group {your resource group name}
70+
az iot hub device-identity create -n {iothub_name} -d {device_id} --ee
5971
```
6072

61-
To [delete a resource group](/cli/azure/group#az-group-delete) and all its resources, run the following command:
73+
The result is a JSON printout which includes your keys and other information.
74+
75+
Alternatively, there are several options to register a device using different kinds of authorization. To explore the options, see [Examples](/device-identity?view=azure-cli-latest#az-iot-hub-device-identity-create-examples&preserve-view=true) on the **az iot hub device-identity** reference page.
76+
77+
## Remove an IoT Hub
78+
79+
There are various commands to [delete an individual resource](/cli/azure/resource), such as an IoT hub.
80+
81+
To [delete an IoT hub](/cli/azure/iot/hub#az-iot-hub-delete), run the following command:
6282

6383
```azurecli-interactive
64-
az group delete --name {your resource group name}
84+
az iot hub delete --name {your iot hub name} -\
85+
-resource-group {your resource group name}
6586
```
6687

6788
## Next steps

articles/iot-hub/iot-hub-create-using-powershell.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,36 @@ ms.custom: devx-track-azurepowershell
1414

1515
[!INCLUDE [iot-hub-resource-manager-selector](../../includes/iot-hub-resource-manager-selector.md)]
1616

17-
## Introduction
18-
1917
You can use Azure PowerShell cmdlets to create and manage Azure IoT hubs. This tutorial shows you how to create an IoT hub with PowerShell.
2018

21-
2219
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
2320

2421
Alternatively, you can use Azure Cloud Shell, if you'd rather not install additional modules onto your machine. The following section gets you started with Azure Cloud Shell.
2522

2623
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
2724

28-
## Connect to your Azure subscription
29-
30-
If you're using Cloud Shell, you're already logged in to your subscription, so you can skip this step. If you're running PowerShell locally instead, enter the following command to sign in to your Azure subscription:
31-
32-
```powershell
33-
# Log into Azure account.
34-
Login-AzAccount
35-
```
36-
37-
## Create a resource group
25+
## Prerequisites
3826

3927
You need a resource group to deploy an IoT hub. You can use an existing resource group or create a new one.
4028

41-
To create a resource group for your IoT hub, use the [New-AzResourceGroup](/powershell/module/az.Resources/New-azResourceGroup) command. This example creates a resource group called **MyIoTRG1** in the **East US** region:
29+
To create a new resource group for your IoT hub, use the [New-AzResourceGroup](/powershell/module/az.Resources/New-azResourceGroup) command. This example creates a resource group called **MyIoTRG1** in the **East US** region:
4230

4331
```azurepowershell-interactive
4432
New-AzResourceGroup -Name MyIoTRG1 -Location "East US"
4533
```
4634

35+
## Connect to your Azure subscription
36+
37+
If you're using Cloud Shell, you're already logged in to your subscription, so you can skip this section. If you're running PowerShell locally instead, enter the following command to sign in to your Azure subscription:
38+
39+
```powershell
40+
# Log into Azure account.
41+
Login-AzAccount
42+
```
43+
4744
## Create an IoT hub
4845

49-
To create an IoT hub in the resource group you created in the previous step, use the [New-AzIotHub](/powershell/module/az.IotHub/New-azIotHub) command. This example creates an **S1** hub called **MyTestIoTHub** in the **East US** region:
46+
Create an IoT hub using your resource group. Use the [New-AzIotHub](/powershell/module/az.IotHub/New-azIotHub) command. This example creates an **S1** hub called **MyTestIoTHub** in the **East US** region:
5047

5148
```azurepowershell-interactive
5249
New-AzIotHub `
@@ -76,11 +73,17 @@ Remove-AzIotHub `
7673
-Name MyTestIoTHub
7774
```
7875

79-
Alternatively, to remove a resource group and all the resources it contains, use the [Remove-AzResourceGroup](/powershell/module/az.Resources/Remove-azResourceGroup) command:
76+
## Update the IoT hub
8077

81-
```azurepowershell-interactive
82-
Remove-AzResourceGroup -Name MyIoTRG1
83-
```
78+
You can change the settings of an existing IoT hub after it's created. Here are some properties you can set for an IoT hub:
79+
80+
**Pricing and scale**: Migrate to a different tier or set the number of IoT Hub units.
81+
82+
**IP Filter**: Specify a range of IP addresses that will be accepted or rejected by the IoT hub.
83+
84+
**Properties**: A list of properties that you can copy and use elsewhere, such as the resource ID, resource group, location, and so on.
85+
86+
Explore the [**Set-AzIotHub** commands](/powershell/module/az.iothub/set-aziothub) for a complete list of update options.
8487

8588
## Next steps
8689

17.9 KB
Loading

0 commit comments

Comments
 (0)