Create an IoT hub using the Azure IoT Hub extension for Visual Studio Code

This article shows you how to use the Azure IoT Hub extension for Visual Studio Code to create an Azure IoT hub.

Note

We recommend that you use the Azure Az PowerShell module to interact with Azure. See Install Azure PowerShell to get started. To learn how to migrate to the Az PowerShell module, see Migrate Azure PowerShell from AzureRM to Az.

Prerequisites

Create an IoT hub

The following steps show how to create an IoT hub in Visual Studio Code (VS Code):

  1. In VS Code, open the Explorer view.

  2. At the bottom of the Explorer, expand the Azure IoT Hub section.

    A screenshot that shows the location of the Azure IoT Hub section in Visual Studio Code.

  3. Select Create IoT Hub from the list in the Azure IoT Hub section.

    A screenshot that shows the location of the Create IoT Hub list item in Visual Studio Code.

  4. If you're not signed into Azure, a pop-up notification is shown in the bottom right corner to let you sign in to Azure. Select Sign In and follow the instructions to sign into Azure.

  5. From the command palette at the top of VS Code, select your Azure subscription.

  6. Select your resource group.

  7. Select a region.

  8. Select a pricing tier.

  9. Enter a globally unique name for your IoT hub, and then select the Enter key.

  10. Wait a few minutes until the IoT hub is created and confirmation is displayed in the Output panel.

Tip

There is no option to delete your IoT hub in Visual Studio Code, however you can delete your hub in the Azure portal.

Next steps

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