Skip to content

Latest commit

 

History

History
60 lines (34 loc) · 3.66 KB

setup_iothub.md

File metadata and controls

60 lines (34 loc) · 3.66 KB

Set up IoT Hub

Azure IoT Hub is a fully managed service that enables reliable and secure bi-directional communications between millions of IoT devices and an application back end. Azure IoT Hub offers reliable device-to-cloud and cloud-to-device hyper-scale messaging, enables secure communications using per-device security credentials and access control, and includes device libraries for the most popular languages and platforms.

Before you can communicate with IoT Hub from a device you must create an IoT hub instance in your Azure subscription and then provision your device in your IoT hub. You must complete these steps before you try to run any of the sample IoT Hub device client applications in this repository (azure-iot-sdks).

Create an IoT hub

You can use the Azure Preview Portal to create an IoT hub to use with your devices.

  1. Log on to the Azure Preview Portal.

  2. In the jumpbar, click New, then click Internet of Things, and then click Azure IoT Hub.

  3. In the New IoT Hub blade, specify the desired configuration for the IoT Hub.

    • In the Name box, enter a name to identify your IoT hub. When the Name is validated, a green check mark appears in the Name box.
    • Change the Pricing and scale tier as desired. This tutorial does not require a specific tier.
    • In the Resource group box, create a new resource group, or select and existing one. For more information, see Using resource groups to manage your Azure resources.
    • Use Location to specify the geographic location in which to host your IoT hub.
  4. Once the new IoT hub options are configured, click Create. It can take a few minutes for the IoT hub to be created. To check the status, you can monitor the progress on the Startboard. Or, you can monitor your progress from the Notifications section.

  5. After the IoT hub has been created successfully, open the blade of the new IoT hub, take note of the URI, and select the Key icon on the top.

  6. Select the Shared access policy called iothubowner, then copy and take note of the connection string on the right blade.

Your IoT hub is now created, and you have the connection string you need to use the iothub-explorer or the Device Explorer tool. This connection string enables applications to perform management operations on the IoT hub such as adding a new device to the IoT hub.

Add devices to IoT Hub

You must add details your device to IoT Hub before that device can communicate with the hub. When you add a device to an IoT hub, the hub generates the connection string that the device must use when it establishes the secure connection to the IoT hub.

To add a device to your IoT hub, you can use the iothub-explorer or the Device Explorer utility in this repository (azure-iot-sdks). These tools will generate a device specific connection string that you need to copy and paste in the source code of the application running on the device.