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
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:
26
26
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.
28
28
29
29
**IP Filter**: Specify a range of IP addresses that will be accepted or rejected by the IoT hub.
30
30
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.
32
34
33
35
### Shared access policies
34
36
@@ -107,7 +109,9 @@ Here are two ways to find a specific IoT hub in your subscription:
107
109
108
110
## Delete the IoT hub
109
111
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":::
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-create-use-iot-toolkit.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,9 @@ This article shows you how to use the [Azure IoT Tools for Visual Studio Code](h
21
21
22
22
-[Visual Studio Code](https://code.visualstudio.com/)
23
23
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
25
27
26
28
## Create an IoT hub without an IoT Project
27
29
@@ -94,6 +96,9 @@ This method allows you to provision in VS Code without leaving your development
94
96
95
97
:::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":::
96
98
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
+
97
102
## Next steps
98
103
99
104
Now that you've deployed an IoT hub using the Azure IoT Tools for Visual Studio Code, explore these articles:
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):
25
21
26
22
```azurecli-interactive
27
23
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.
33
29
> ```azurecli-interactive
34
30
> az account list-locations -o table
35
31
> ```
36
-
>
37
32
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:
39
38
40
39
```azurecli-interactive
41
40
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.
47
46
48
47
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/).
49
48
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.
51
50
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
53
52
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).
55
68
56
69
```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
59
71
```
60
72
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:
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.
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
38
26
39
27
You need a resource group to deploy an IoT hub. You can use an existing resource group or create a new one.
40
28
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:
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
+
47
44
## Create an IoT hub
48
45
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:
50
47
51
48
```azurepowershell-interactive
52
49
New-AzIotHub `
@@ -76,11 +73,17 @@ Remove-AzIotHub `
76
73
-Name MyTestIoTHub
77
74
```
78
75
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
80
77
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.
0 commit comments