title | description | author | ms.service | services | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|
Create an Azure IoT Hub using Azure IoT Tools for VS Code | Microsoft Docs |
Learn how to use the Azure IoT tools for Visual Studio Code to create an Azure IoT hub in a resource group. |
formulahendry |
iot-hub |
iot-hub |
conceptual |
01/04/2019 |
junhan |
[!INCLUDE iot-hub-resource-manager-selector]
This article shows you how to use the Azure IoT Tools for Visual Studio Code to create an Azure IoT hub.
[!INCLUDE updated-for-az]
To complete this article, you need the following:
-
An Azure subscription. If you don't have an Azure subscription, create a free account before you begin.
-
Azure IoT Tools installed for Visual Studio Code.
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.
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.
-
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.[!NOTE] If you have not signed in Azure. Follow the pop-up notification for signing in.
-
Select the subscription you want to use.
-
Then select and existing resource group or create a new resource group.
-
In the resource group you specified, follow the prompts to select an existing IoT Hub or create a new Azure IoT Hub.
-
In the output window, you will see the Azure IoT Hub provisioned.
-
Select or create a new IoT Hub Device in the Azure IoT Hub you provisioned.
-
Now you have Azure IoT Hub provisioned and device created in it. Also the device connection string will be saved in VS Code.
The following steps show how you can create an IoT Hub without an IoT Project in Visual Studio Code.
-
In Visual Studio Code, open the Explorer view.
-
At the bottom of the Explorer, expand the Azure IoT Hub section.
-
Click on the ... in the Azure IoT Hub section header. If you don't see the ellipsis, hover over the header.
-
Choose Create IoT Hub.
-
A pop-up will show in the bottom-right corner to let you sign in to Azure for the first time.
-
Select Azure subscription.
-
Select resource group.
-
Select location.
-
Select pricing tier.
-
Enter a globally unique name for your IoT Hub.
-
Wait a few minutes until the IoT Hub is created.
Now you have deployed an IoT hub using the Azure IoT Tools for Visual Studio Code. To explore further, check out the following articles: