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
This article shows you how to use the [Azure IoT Tools for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-tools) to create an Azure IoT hub.
16
+
This article shows you how to use the [Azure IoT Tools for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-tools) to create an Azure IoT hub. You can create one without an existing IoT project or create one from an existing IoT project.
- An Azure subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
20
+
## Prerequisites
23
21
24
22
-[Visual Studio Code](https://code.visualstudio.com/)
25
23
26
24
-[Azure IoT Tools](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-tools) installed for Visual Studio Code.
27
25
26
+
## Create an IoT hub without an IoT Project
28
27
29
-
## Create an IoT hub and device in an IoT Project
30
-
31
-
The following steps show how you can create an IoT Hub and register a device to the hub within an IoT Project in Visual Studio Code.
32
-
33
-
Instead of provisioning an Azure IoT Hub and device from the Azure portal. You can do it in the VS Code without leaving the development environment. The steps in this section show how to do this.
34
-
35
-
1. In the new opened project window, click `F1` to open the command palette, type and select **Azure IoT Device Workbench: Provision Azure Services...**. Follow the step-by-step guide to finish provisioning your Azure IoT Hub and creating the IoT Hub device.
28
+
The following steps show how to create an IoT Hub without an IoT Project in Visual Studio Code (VS Code).
> If you have not signed in Azure. Follow the pop-up notification for signing in.
32
+
2. At the bottom of the Explorer, expand the **Azure IoT Hub** section.
41
33
42
-
1. Select the subscription you want to use.
34
+
:::image type="content" source="./media/iot-hub-create-use-iot-toolkit/azure-iot-hub-devices.png" alt-text="A screenshot that shows the location of the Azure IoT Hub section in VS Code." lightbox="./media/iot-hub-create-use-iot-toolkit/azure-iot-hub-devices.png":::
3. Select **Create IoT Hub** from the list in the **Azure IoT Hub** section.
45
37
46
-
1. Then select and existing resource group or create a new [resource group](../azure-resource-manager/management/overview.md#terminology).
38
+
:::image type="content" source="./media/iot-hub-create-use-iot-toolkit/create-iot-hub.png" alt-text="A screenshot that shows the location of the Create IoT Hub list item in VS Code." lightbox="./media/iot-hub-create-use-iot-toolkit/create-iot-hub.png":::
This method allows you to provision in VS Code without leaving your development environment.
67
59
68
-
1.Now you have Azure IoT Hub provisioned and device created in it. Also the device connection string will be saved in VS Code.
60
+
1.In the new opened project window, click `F1` to open the command palette, type and select **Azure IoT Device Workbench: Provision Azure Services...**. Follow the step-by-step guide to finish provisioning your Azure IoT Hub and creating the IoT Hub device.
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/provision.png" alt-text="A screenshot that shows how to open the command palette in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/provision.png":::
71
63
64
+
> [!NOTE]
65
+
> If you have not signed in Azure. Follow the pop-up notification for signing in.
72
66
67
+
1. Select the subscription you want to use.
73
68
74
-
## Create an IoT hub without an IoT Project
69
+
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/select-subscription.png" alt-text="A screenshot that shows how to choose your Azure subscription in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/select-subscription.png":::
75
70
76
-
The following steps show how you can create an IoT Hub without an IoT Project in Visual Studio Code.
71
+
1. Then select and existing resource group or create a new [resource group](../azure-resource-manager/management/overview.md#terminology).
77
72
78
-
1. In Visual Studio Code, open the **Explorer** view.
73
+
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/select-resource-group.png" alt-text="A screenshot that shows how to choose a resource group or create a new one in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/select-resource-group.png":::
79
74
80
-
2. At the bottom of the Explorer, expand the **Azure IoT Hub** section.
75
+
1. In the resource group you specified, follow the prompts to select an existing IoT Hub or create a new Azure IoT Hub.
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/iot-hub-provision.png" alt-text="A screenshot that shows the first prompt in choosing an existing IoT Hub in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/iot-hub-provision.png":::
83
78
84
-
3. Click on the **...** in the **Azure IoT Hub** section header. If you don't see the ellipsis, hover over the header.
79
+
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/select-iot-hub.png" alt-text="A screenshot that shows the second prompt in choosing an existing IoT Hub in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/select-iot-hub.png":::
85
80
86
-
4. Choose **Create IoT Hub**.
81
+
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/iot-hub-selected.png" alt-text="A screenshot that shows the third prompt in choosing an existing IoT Hub in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/iot-hub-selected.png":::
87
82
88
-
5. A pop-up will show in the bottom-right corner to let you sign in to Azure for the first time.
83
+
1. In the output window, you'll see the Azure IoT Hub provisioned.
89
84
90
-
6. Select Azure subscription.
85
+
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/iot-hub-provisioned.png" alt-text="A screenshot that shows the output window in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/iot-hub-provisioned.png":::
91
86
92
-
7. Select resource group.
87
+
1. Select or create a new IoT Hub Device in the Azure IoT Hub you provisioned.
93
88
94
-
8. Select location.
89
+
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/iot-device-provision.png" alt-text="A screenshot that shows the fourth prompt in choosing an existing IoT Hub in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/iot-device-provision.png":::
95
90
96
-
9. Select pricing tier.
91
+
:::image type="content" source="media/iot-hub-create-use-iot-toolkit/select-iot-device.png" alt-text="A screenshot that shows an example of an existing IoT Hub in VS Code." lightbox="media/iot-hub-create-use-iot-toolkit/select-iot-device.png":::
97
92
98
-
10. Enter a globally unique name for your IoT Hub.
93
+
1. Now you have Azure IoT Hub provisioned and device created in it. Also the device connection string will be saved in VS Code.
99
94
100
-
11. Wait a few minutes until the IoT Hub is created.
95
+
:::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":::
101
96
102
97
## Next steps
103
98
104
-
Now you have deployed an IoT hub using the Azure IoT Tools for Visual Studio Code. To explore further, check out the following articles:
99
+
Now that you've deployed an IoT hub using the Azure IoT Tools for Visual Studio Code, explore these articles:
105
100
106
101
*[Use the Azure IoT Tools for Visual Studio Code to send and receive messages between your device and an IoT Hub](iot-hub-vscode-iot-toolkit-cloud-device-messaging.md).
0 commit comments